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>
This commit is contained in:
Devendra Naga 2012-10-23 18:04:32 -04:00 committed by Greg Kroah-Hartman
parent 7fc465b106
commit 0608882d01

View file

@ -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;