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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;