aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-08-31 04:54:37 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 15:02:34 -0400
commita2279ae5b58edb7cbe2196d08572fcf59f292354 (patch)
treebd388ddaa7835818f485c898347cd16afc42b05b /drivers
parent14386fd10c33b6a6a53901a64832f34f038857cf (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/comedi/drivers/addi-data/addi_amcc_s5933.h3
-rw-r--r--drivers/staging/comedi/drivers/addi-data/amcc_s5933_58.h3
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 d288289143ea..f96b1289cdfc 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)
261 pci_vendor = i_ADDIDATADeviceID[i_Count]; 261 pci_vendor = i_ADDIDATADeviceID[i_Count];
262 if (pcidev->vendor == pci_vendor) { 262 if (pcidev->vendor == pci_vendor) {
263 amcc = kmalloc(sizeof(*amcc), GFP_KERNEL); 263 amcc = kmalloc(sizeof(*amcc), GFP_KERNEL);
264 if (amcc == NULL)
265 continue;
266
264 memset(amcc, 0, sizeof(*amcc)); 267 memset(amcc, 0, sizeof(*amcc));
265 268
266 amcc->pcidev = pcidev; 269 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 b76f877f250a..49141b3558e1 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)
254 pci_for_each_dev(pcidev) { 254 pci_for_each_dev(pcidev) {
255 if (pcidev->vendor == pci_vendor) { 255 if (pcidev->vendor == pci_vendor) {
256 amcc = kmalloc(sizeof(*amcc), GFP_KERNEL); 256 amcc = kmalloc(sizeof(*amcc), GFP_KERNEL);
257 if (amcc == NULL)
258 continue;
259
257 memset(amcc, 0, sizeof(*amcc)); 260 memset(amcc, 0, sizeof(*amcc));
258 261
259 amcc->pcidev = pcidev; 262 amcc->pcidev = pcidev;