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>
This commit is contained in:
parent
451084d2e0
commit
2c77cb3e05
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Reference in a new issue