diff options
author | Dan Carpenter <error27@gmail.com> | 2009-01-20 15:07:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 14:53:28 -0700 |
commit | 2c77cb3e0595dd0c2dfeb548a9474a513d14a74b (patch) | |
tree | 5bc9080bf1ba7315a3ffe06e9c2f5fbe97e20d15 /drivers | |
parent | 451084d2e056ab9ef0ae6afe59556dadc2f416aa (diff) | |
download | blackbird-op-linux-2c77cb3e0595dd0c2dfeb548a9474a513d14a74b.tar.gz blackbird-op-linux-2c77cb3e0595dd0c2dfeb548a9474a513d14a74b.zip |
Staging: altpciechdma: Null deref in altpciechdma.c remove()
If dev is NULL it prints an error message. The error message dereferences
dev.
Compile tested only.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: Leon Woestenberg <leon.woestenberg@axon.tv>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/altpciechdma/altpciechdma.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/altpciechdma/altpciechdma.c b/drivers/staging/altpciechdma/altpciechdma.c index 3e04a6227826..27059bcc4020 100644 --- a/drivers/staging/altpciechdma/altpciechdma.c +++ b/drivers/staging/altpciechdma/altpciechdma.c @@ -946,7 +946,8 @@ static void __devexit remove(struct pci_dev *dev) struct ape_dev *ape; printk(KERN_DEBUG "remove(0x%p)\n", dev); if ((dev == 0) || (dev->dev.driver_data == 0)) { - printk(KERN_DEBUG "remove(dev = 0x%p) dev->dev.driver_data = 0x%p\n", dev, dev->dev.driver_data); + printk(KERN_DEBUG "remove(dev = 0x%p) dev->dev.driver_data = 0x%p\n", + dev, (dev? dev->dev.driver_data: NULL)); return; } ape = (struct ape_dev *)dev->dev.driver_data; |