diff options
author | Devendra Naga <devendra.aaru@gmail.com> | 2012-10-23 22:04:32 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-24 03:28:20 (GMT) |
commit | 0608882d01671983be20097e3ffd6be20c9a7724 (patch) | |
tree | b379fd235067ee673841466cb8f2e39c4b8d400e | |
parent | 7fc465b106b40a598d83a0c98d0e8c2a1b4653ff (diff) | |
download | linux-0608882d01671983be20097e3ffd6be20c9a7724.tar.xz |
staging: slicoss: return -ENOMEM if kzalloc fail
this takes up the error path cleanup,
fixes a crash too due to null deref
Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/slicoss/slicoss.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c index 9454280..f6af3fe 100644 --- a/drivers/staging/slicoss/slicoss.c +++ b/drivers/staging/slicoss/slicoss.c @@ -3667,6 +3667,8 @@ static u32 slic_card_locate(struct adapter *adapter) if (!physcard) { /* no structure allocated for this physical card yet */ physcard = kzalloc(sizeof(struct physcard), GFP_ATOMIC); + if (!physcard) + return -ENOMEM; physcard->next = slic_global.phys_card; slic_global.phys_card = physcard; |