diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-08-31 08:54:37 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 19:02:34 (GMT) |
commit | a2279ae5b58edb7cbe2196d08572fcf59f292354 (patch) | |
tree | bd388ddaa7835818f485c898347cd16afc42b05b | |
parent | 14386fd10c33b6a6a53901a64832f34f038857cf (diff) | |
download | linux-a2279ae5b58edb7cbe2196d08572fcf59f292354.tar.xz |
Staging: comedi: addi-data: NULL dereference of amcc in v_pci_card_list_init()
amcc allocation may fail, prevent a NULL dereference.
allocation may fail, prevent a dereference.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h | 3 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h b/drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h index d288289..f96b128 100644 --- a/drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h +++ b/drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h @@ -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; diff --git a/drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h b/drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h index b76f877..49141b3 100644 --- a/drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h +++ b/drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h @@ -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; |