Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72150e9b authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ea3fb371
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2288,6 +2288,7 @@ int proto_register(struct proto *prot, int alloc_slab)
		prot->rsk_prot->slab = NULL;
		prot->rsk_prot->slab = NULL;
	}
	}
out_free_request_sock_slab_name:
out_free_request_sock_slab_name:
	if (prot->rsk_prot)
		kfree(prot->rsk_prot->slab_name);
		kfree(prot->rsk_prot->slab_name);
out_free_sock_slab:
out_free_sock_slab:
	kmem_cache_destroy(prot->slab);
	kmem_cache_destroy(prot->slab);