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:
Родитель
7fc465b106
Коммит
0608882d01
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче