Commit 2c77cb3e authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

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: default avatarDan Carpenter <error27@gmail.com>
Cc: Leon Woestenberg <leon.woestenberg@axon.tv>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 451084d2
......@@ -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;
......
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