diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2006-12-08 02:38:54 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 08:28:57 -0800 |
commit | f0671378426d9768bf20d5e0f8389374dcdc2abf (patch) | |
tree | 232da6f0310b63e1ab921f5c60d67dc6b77f060d /drivers/char | |
parent | 78028da91e05146c9ce0c9db2fea53e0cded1e81 (diff) |
[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>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/isicom.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index 91b97844522..783a7ec0a8e 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); |