xen/pciback: Check dev_data before using it
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Fri, 14 Dec 2018 12:55:45 +0000 (12:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:27 +0000 (15:37 +0100)
commite50bf6849f4de99385ba6bbc548cc0ecc86a5cdb
tree72100a3c45d94fa87fe59502a4fab7de40392090
parente8113c362adcb8735c81f80cf24d781708047ce1
xen/pciback: Check dev_data before using it

[ Upstream commit 1669907e3d1abfa3f7586e2d55dbbc117b5adba2 ]

If pcistub_init_device fails, the release function will be called with
dev_data set to NULL.  Check it before using it to avoid a NULL pointer
dereference.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/xen/xen-pciback/pci_stub.c