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

[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
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);