]> git.baikalelectronics.ru Git - kernel.git/commit
xen-pciback: fix up cleanup path when alloc fails
authorDoug Goldstein <cardoe@cardoe.com>
Thu, 26 Nov 2015 20:32:39 +0000 (14:32 -0600)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 18 Dec 2015 16:38:48 +0000 (11:38 -0500)
commit82fc65970cb9161fd4d5c8300f8de278de6050f1
treed4882559fa179adcfb71ffebf0e2158fabb6cbd1
parent1030c86bf507433fc6aa0148815a044ee8825e28
xen-pciback: fix up cleanup path when alloc fails

When allocating a pciback device fails, clear the private
field. This could lead to an use-after free, however
the 'really_probe' takes care of setting
dev_set_drvdata(dev, NULL) in its failure path (which we would
exercise if the ->probe function failed), so we we
are OK. However lets be defensive as the code can change.

Going forward we should clean up the pci_set_drvdata(dev, NULL)
in the various code-base. That will be for another day.

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reported-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/xen-pciback/xenbus.c