Commit f0671378 authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

[PATCH] Char: isicom, check kmalloc retval

Value returned from kamlloc may be NULL, we should check if ENOMEM occured.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Acked-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 78028da9
...@@ -1709,6 +1709,11 @@ static int __devinit load_firmware(struct pci_dev *pdev, ...@@ -1709,6 +1709,11 @@ static int __devinit load_firmware(struct pci_dev *pdev,
} }
data = kmalloc(word_count * 2, GFP_KERNEL); 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); inw(base);
insw(base, data, word_count); insw(base, data, word_count);
InterruptTheCard(base); InterruptTheCard(base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment