]> www.infradead.org Git - users/jedix/linux-maple.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)
committerJoao Martins <joao.m.martins@oracle.com>
Sun, 27 Mar 2016 01:01:42 +0000 (02:01 +0100)
commit4dbddbbf7bec2411500e8287022f0a15b2922063
tree22e8ab548681645776d274414ae337e35955149e
parent0fe94acfdc97180f40eb013bf2e8362093eeed5e
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>
(cherry picked from commit 584a561a6fee0d258f9ca644f58b73d9a41b8a46)
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
drivers/xen/xen-pciback/xenbus.c