提交 0608882d 编写于 作者: D Devendra Naga 提交者: 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: NDevendra Naga <devendra.aaru@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册