stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Ross Lagerwall <ross.lagerwall@citrix.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 4.9 038/125] xen/pciback: Check dev_data before using it
Date: Wed,  4 Dec 2019 18:55:43 +0100	[thread overview]
Message-ID: <20191204175321.291260266@linuxfoundation.org> (raw)
In-Reply-To: <20191204175308.377746305@linuxfoundation.org>

From: Ross Lagerwall <ross.lagerwall@citrix.com>

[ 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index 6331a95691a44..ee5ce9286d613 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -106,7 +106,8 @@ static void pcistub_device_release(struct kref *kref)
 	 * is called from "unbind" which takes a device_lock mutex.
 	 */
 	__pci_reset_function_locked(dev);
-	if (pci_load_and_free_saved_state(dev, &dev_data->pci_saved_state))
+	if (dev_data &&
+	    pci_load_and_free_saved_state(dev, &dev_data->pci_saved_state))
 		dev_info(&dev->dev, "Could not reload PCI state\n");
 	else
 		pci_restore_state(dev);
-- 
2.20.1




  parent reply	other threads:[~2019-12-04 18:12 UTC|newest]

Thread overview: 133+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 17:55 [PATCH 4.9 000/125] 4.9.206-stable review Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 001/125] ASoC: compress: fix unsigned integer overflow check Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 002/125] ASoC: kirkwood: fix external clock probe defer Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 003/125] clk: samsung: exynos5420: Preserve PLL configuration during suspend/resume Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 004/125] reset: fix reset_control_ops kerneldoc comment Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 005/125] clk: at91: avoid sleeping early Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 006/125] net: fec: add missed clk_disable_unprepare in remove Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 007/125] can: peak_usb: report bus recovery as well Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 008/125] can: c_can: D_CAN: c_can_chip_config(): perform a sofware reset on open Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 009/125] watchdog: meson: Fix the wrong value of left time Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 010/125] scripts/gdb: fix debugging modules compiled with hot/cold partitioning Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 011/125] mac80211: fix station inactive_time shortly after boot Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 012/125] block: drbd: remove a stray unlock in __drbd_send_protocol() Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 013/125] pwm: bcm-iproc: Prevent unloading the driver module while in use Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 014/125] scsi: lpfc: Fix dif and first burst use in write commands Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 015/125] ARM: debug-imx: only define DEBUG_IMX_UART_PORT if needed Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 016/125] ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 017/125] parisc: Fix serio address output Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 018/125] parisc: Fix HP SDC hpa " Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 019/125] arm64: mm: Prevent mismatched 52-bit VA support Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 020/125] arm64: smp: Handle errors reported by the firmware Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 021/125] PM / AVS: SmartReflex: NULL check before some freeing functions is not needed Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 022/125] ARM: ks8695: fix section mismatch warning Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 023/125] ACPI / LPSS: Ignore acpi_device_fix_up_power() return value Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 024/125] crypto: user - support incremental algorithm dumps Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 025/125] mwifiex: fix potential NULL dereference and use after free Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 026/125] mwifiex: debugfs: correct histogram spacing, formatting Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 027/125] rtl818x: fix potential use after free Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 028/125] xfs: require both realtime inodes to mount Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 029/125] ubi: Put MTD device after it is not used Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 030/125] ubi: Do not drop UBI device reference before using Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 031/125] microblaze: adjust the help to the real behavior Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 032/125] microblaze: move "... is ready" messages to arch/microblaze/Makefile Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 033/125] gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 034/125] VSOCK: bind to random port for VMADDR_PORT_ANY Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 035/125] mtd: rawnand: sunxi: Write pageprog related opcodes to WCMD_SET Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 036/125] btrfs: only track ref_heads in delayed_ref_updates Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 037/125] HID: intel-ish-hid: fixes incorrect error handling Greg Kroah-Hartman
2019-12-04 17:55 ` Greg Kroah-Hartman [this message]
2019-12-04 17:55 ` [PATCH 4.9 039/125] pinctrl: xway: fix gpio-hog related boot issues Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 040/125] net/mlx5: Continue driver initialization despite debugfs failure Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 041/125] KVM: s390: unregister debug feature on failing arch init Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 042/125] pinctrl: sh-pfc: sh7264: Fix PFCR3 and PFCR0 register configuration Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 043/125] pinctrl: sh-pfc: sh7734: Fix shifted values in IPSR10 Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 044/125] HID: doc: fix wrong data structure reference for UHID_OUTPUT Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 045/125] dm flakey: Properly corrupt multi-page bios Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 046/125] gfs2: take jdata unstuff into account in do_grow Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 047/125] xfs: Align compat attrlist_by_handle with native implementation Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 048/125] xfs: Fix bulkstat compat ioctls on x32 userspace Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 049/125] IB/qib: Fix an error code in qib_sdma_verbs_send() Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 050/125] powerpc/book3s/32: fix number of bats in p/v_block_mapped() Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 051/125] powerpc/xmon: fix dump_segments() Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 052/125] drivers/regulator: fix a missing check of return value Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 053/125] serial: max310x: Fix tx_empty() callback Greg Kroah-Hartman
2019-12-04 17:55 ` [PATCH 4.9 054/125] openrisc: Fix broken paths to arch/or32 Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 055/125] RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 056/125] scsi: qla2xxx: deadlock by configfs_depend_item Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 057/125] scsi: csiostor: fix incorrect dma device in case of vport Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 058/125] ath6kl: Only use match sets when firmware supports it Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 059/125] ath6kl: Fix off by one error in scan completion Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 060/125] powerpc/prom: fix early DEBUG messages Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 061/125] powerpc/mm: Make NULL pointer deferences explicit on bad page faults Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 062/125] powerpc/44x/bamboo: Fix PCI range Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 063/125] vfio/spapr_tce: Get rid of possible infinite loop Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 064/125] powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 065/125] drbd: ignore "all zero" peer volume sizes in handshake Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 066/125] drbd: reject attach of unsuitable uuids even if connected Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 067/125] drbd: do not block when adjusting "disk-options" while IO is frozen Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 068/125] drbd: fix print_st_err()s prototype to match the definition Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 069/125] regulator: tps65910: fix a missing check of return value Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 070/125] powerpc/83xx: handle machine check caused by watchdog timer Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 071/125] powerpc/pseries: Fix node leak in update_lmb_associativity_index() Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 072/125] crypto: mxc-scc - fix build warnings on ARM64 Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 073/125] pwm: clps711x: Fix period calculation Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 074/125] net/net_namespace: Check the return value of register_pernet_subsys() Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 075/125] um: Make GCOV depend on !KCOV Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 076/125] net: stmicro: fix a missing check of clk_prepare Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 077/125] net: dsa: bcm_sf2: Propagate error value from mdio_write Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 078/125] atl1e: checking the status of atl1e_write_phy_reg Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 079/125] tipc: fix a missing check of genlmsg_put Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 080/125] net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 081/125] ocfs2: clear journal dirty flag after shutdown journal Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 082/125] vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 083/125] lib/genalloc.c: fix allocation of aligned buffer from non-aligned chunk Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 084/125] lib/genalloc.c: use vzalloc_node() to allocate the bitmap Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 085/125] drivers/base/platform.c: kmemleak ignore a known leak Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 086/125] lib/genalloc.c: include vmalloc.h Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 087/125] mtd: Check add_mtd_device() ret code Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 088/125] tipc: fix memory leak in tipc_nl_compat_publ_dump Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 089/125] net/core/neighbour: tell kmemleak about hash tables Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 090/125] net/core/neighbour: fix kmemleak minimal reference count for " Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 091/125] sfc: suppress duplicate nvmem partition types in efx_ef10_mtd_probe Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 092/125] ip_tunnel: Make none-tunnel-dst tunnel port work with lwtunnel Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 093/125] decnet: fix DN_IFREQ_SIZE Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 094/125] tipc: fix skb may be leaky in tipc_link_input Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 095/125] sfc: initialise found bitmap in efx_ef10_mtd_probe Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 096/125] net: fix possible overflow in __sk_mem_raise_allocated() Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 097/125] sctp: dont compare hb_timer expire date before starting it Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 098/125] net: dev: Use unsigned integer as an argument to left-shift Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 099/125] iommu/amd: Fix NULL dereference bug in match_hid_uid Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 100/125] scsi: libsas: Support SATA PHY connection rate unmatch fixing during discovery Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 101/125] ACPI / APEI: Switch estatus pool to use vmalloc memory Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 102/125] scsi: libsas: Check SMP PHY control function result Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 103/125] powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property() Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 104/125] mtd: Remove a debug trace in mtdpart.c Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 105/125] mm, gup: add missing refcount overflow checks on x86 and s390 Greg Kroah-Hartman
2019-12-04 18:27   ` Vlastimil Babka
2019-12-04 20:37     ` Greg Kroah-Hartman
2019-12-04 22:53       ` Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 106/125] clk: at91: fix update bit maps on CFG_MOR write Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 107/125] staging: rtl8192e: fix potential use after free Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 108/125] USB: serial: ftdi_sio: add device IDs for U-Blox C099-F9P Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 109/125] mei: bus: prefix device names on bus with the bus name Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 110/125] media: v4l2-ctrl: fix flags for DO_WHITE_BALANCE Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 111/125] net: macb: fix error format in dev_err() Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 112/125] pwm: Clear chip_data in pwm_put() Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 113/125] media: atmel: atmel-isc: fix asd memory allocation Greg Kroah-Hartman
2019-12-04 17:56 ` [PATCH 4.9 114/125] macvlan: schedule bc_work even if error Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 115/125] openvswitch: fix flow command message size Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 116/125] slip: Fix use-after-free Read in slip_open Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 117/125] openvswitch: drop unneeded BUG_ON() in ovs_flow_cmd_build_info() Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 118/125] openvswitch: remove another BUG_ON() Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 119/125] tipc: fix link name length check Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 120/125] sctp: cache netns in sctp_ep_common Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 121/125] net: sched: fix `tc -s class show` no bstats on class with nolock subqueues Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 122/125] HID: core: check whether Usage Page item is after Usage ID items Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 123/125] hwrng: stm32 - fix unbalanced pm_runtime_enable Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 124/125] platform/x86: hp-wmi: Fix ACPI errors caused by too small buffer Greg Kroah-Hartman
2019-12-04 17:57 ` [PATCH 4.9 125/125] net: fec: fix clock count mis-match Greg Kroah-Hartman
2019-12-05  5:34 ` [PATCH 4.9 000/125] 4.9.206-stable review Naresh Kamboju
2019-12-05  6:59 ` Jon Hunter
2019-12-05 14:13 ` Guenter Roeck
2019-12-11 23:17 ` shuah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191204175321.291260266@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=boris.ostrovsky@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ross.lagerwall@citrix.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).