Skip to content

Commit

Permalink
[PATCH] uml: kfree cleanup
Browse files Browse the repository at this point in the history
Here's a small patch to remove a few unnessesary NULL pointer checks before
kfree() in arch/um/drivers/daemon_user.c

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jesper Juhl authored and Linus Torvalds committed Jun 25, 2005
1 parent 350d5bd commit 41f2148
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/um/drivers/daemon_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ static void daemon_remove(void *data)

os_close_file(pri->fd);
os_close_file(pri->control);
if(pri->data_addr != NULL) kfree(pri->data_addr);
if(pri->ctl_addr != NULL) kfree(pri->ctl_addr);
if(pri->local_addr != NULL) kfree(pri->local_addr);
kfree(pri->data_addr);
kfree(pri->ctl_addr);
kfree(pri->local_addr);
}

int daemon_user_write(int fd, void *buf, int len, struct daemon_data *pri)
Expand Down

0 comments on commit 41f2148

Please sign in to comment.