提交 f0671378 编写于 作者: J Jiri Slaby 提交者: Linus Torvalds

[PATCH] Char: isicom, check kmalloc retval

Value returned from kamlloc may be NULL, we should check if ENOMEM occured.
Signed-off-by: NJiri Slaby <jirislaby@gmail.com>
Acked-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 78028da9
......@@ -1709,6 +1709,11 @@ static int __devinit load_firmware(struct pci_dev *pdev,
}
data = kmalloc(word_count * 2, GFP_KERNEL);
if (data == NULL) {
dev_err(&pdev->dev, "Card%d, firmware upload "
"failed, not enough memory\n", index + 1);
goto errrelfw;
}
inw(base);
insw(base, data, word_count);
InterruptTheCard(base);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册