* [patch] sock.c: potential null dereference
@ 2010-03-06 11:04 Dan Carpenter
2010-03-07 23:28 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-03-06 11:04 UTC (permalink / raw)
To: netdev
Cc: Eric Dumazet, Jan Engelhardt, Ingo Molnar, David S. Miller,
Andrew Morton, linux-kernel, kernel-janitors
We test that "prot->rsk_prot" is non-null right before we dereference it
on this line.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/core/sock.c b/net/core/sock.c
index fcd397a..fa427b5 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2276,7 +2276,8 @@ out_free_request_sock_slab:
prot->rsk_prot->slab = NULL;
}
out_free_request_sock_slab_name:
- kfree(prot->rsk_prot->slab_name);
+ if (prot->rsk_prot)
+ kfree(prot->rsk_prot->slab_name);
out_free_sock_slab:
kmem_cache_destroy(prot->slab);
prot->slab = NULL;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-07 23:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-06 11:04 [patch] sock.c: potential null dereference Dan Carpenter
2010-03-07 23:28 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox