1
0
Fork 0

[PATCH] Char: isicom, check kmalloc retval

Value returned from kamlloc may be NULL, we should check if ENOMEM occured.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
hifive-unleashed-5.1
Jiri Slaby 2006-12-08 02:38:54 -08:00 committed by Linus Torvalds
parent 78028da91e
commit f067137842
1 changed files with 5 additions and 0 deletions

View File

@ -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);