Commit 82d78041 authored by Roel Kluin's avatar Roel Kluin Committed by James Toy

amcc allocation may fail, prevent a NULL dereference.

allocation may fail, prevent a dereference.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: <devel@driverdev.osuosl.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 12519b77
......@@ -261,6 +261,9 @@ void v_pci_card_list_init(unsigned short pci_vendor, char display)
pci_vendor = i_ADDIDATADeviceID[i_Count];
if (pcidev->vendor == pci_vendor) {
amcc = kmalloc(sizeof(*amcc), GFP_KERNEL);
if (amcc == NULL)
continue;
memset(amcc, 0, sizeof(*amcc));
amcc->pcidev = pcidev;
......
......@@ -254,6 +254,9 @@ void v_pci_card_list_init(unsigned short pci_vendor, char display)
pci_for_each_dev(pcidev) {
if (pcidev->vendor == pci_vendor) {
amcc = kmalloc(sizeof(*amcc), GFP_KERNEL);
if (amcc == NULL)
continue;
memset(amcc, 0, sizeof(*amcc));
amcc->pcidev = pcidev;
......
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