Commit 0608882d authored by Devendra Naga's avatar Devendra Naga Committed by Greg Kroah-Hartman

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: default avatarDevendra Naga <devendra.aaru@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7fc465b1
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment