lkml.org 
[lkml]   [2005]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] net/socket.c : remove redundant NULL pointer check before kfree()

kfree() handles NULL pointers just fine, checking first is pointless.


Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

--- linux-2.6.11-mm4-orig/net/socket.c 2005-03-16 15:45:42.000000000 +0100
+++ linux-2.6.11-mm4/net/socket.c 2005-03-17 20:25:36.000000000 +0100
@@ -993,8 +993,7 @@ static int sock_fasync(int fd, struct fi
sock = SOCKET_I(filp->f_dentry->d_inode);

if ((sk=sock->sk) == NULL) {
- if (fna)
- kfree(fna);
+ kfree(fna);
return -EINVAL;
}




(Please CC me on replies to lists other than linux-kernel)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:11    [W:0.133 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site