diff options
author | Dan Carpenter <error27@gmail.com> | 2010-03-05 20:04:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-07 18:25:50 -0500 |
commit | 72150e9b7fec217fbd646a29ea2f65a3d4d55ea9 (patch) | |
tree | 5c049ed5ec0642cd408286cc049917e2a0d2520d | |
parent | ea3fb371b2a391958670f2a65e1203f7dba61671 (diff) |
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 <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/sock.c | 3 |
1 files changed, 2 insertions, 1 deletions
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: | |||
2288 | prot->rsk_prot->slab = NULL; | 2288 | prot->rsk_prot->slab = NULL; |
2289 | } | 2289 | } |
2290 | out_free_request_sock_slab_name: | 2290 | out_free_request_sock_slab_name: |
2291 | kfree(prot->rsk_prot->slab_name); | 2291 | if (prot->rsk_prot) |
2292 | kfree(prot->rsk_prot->slab_name); | ||
2292 | out_free_sock_slab: | 2293 | out_free_sock_slab: |
2293 | kmem_cache_destroy(prot->slab); | 2294 | kmem_cache_destroy(prot->slab); |
2294 | prot->slab = NULL; | 2295 | prot->slab = NULL; |