diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index 91b978445229edfc1a527d9e566327f3e8019c22..783a7ec0a8e61ad87cf1fc27b5b4563cd2565221 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c @@ -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);