From: Dan Carpenter Date: Sat, 6 Mar 2010 01:04:45 +0000 (+0000) Subject: sock.c: potential null dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=72150e9b7fec217fbd646a29ea2f65a3d4d55ea9;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git sock.c: potential null dereference We test that "prot->rsk_prot" is non-null right before we dereference it on this line. Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/net/core/sock.c b/net/core/sock.c index 61a65a2e0455..c5812bbc2cc9 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -2288,7 +2288,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;