From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34944 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034631AbdAIP2b (ORCPT ); Mon, 9 Jan 2017 10:28:31 -0500 Subject: Patch "powerpc/pci/rpadlpar: Fix device reference leaks" has been added to the 4.9-stable tree To: johan@kernel.org, gregkh@linuxfoundation.org, mpe@ellerman.id.au Cc: , From: Date: Mon, 09 Jan 2017 16:27:41 +0100 Message-ID: <148397566123124@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled powerpc/pci/rpadlpar: Fix device reference leaks to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: powerpc-pci-rpadlpar-fix-device-reference-leaks.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 99e5cde5eae78bef95bfe7c16ccda87fb070149b Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 1 Nov 2016 16:26:03 +0100 Subject: powerpc/pci/rpadlpar: Fix device reference leaks From: Johan Hovold commit 99e5cde5eae78bef95bfe7c16ccda87fb070149b upstream. Make sure to drop any device reference taken by vio_find_node() when adding and removing virtual I/O slots. Fixes: 5eeb8c63a38f ("[PATCH] PCI Hotplug: rpaphp: Move VIO registration") Signed-off-by: Johan Hovold Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- drivers/pci/hotplug/rpadlpar_core.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- a/drivers/pci/hotplug/rpadlpar_core.c +++ b/drivers/pci/hotplug/rpadlpar_core.c @@ -257,8 +257,13 @@ static int dlpar_add_phb(char *drc_name, static int dlpar_add_vio_slot(char *drc_name, struct device_node *dn) { - if (vio_find_node(dn)) + struct vio_dev *vio_dev; + + vio_dev = vio_find_node(dn); + if (vio_dev) { + put_device(&vio_dev->dev); return -EINVAL; + } if (!vio_register_device_node(dn)) { printk(KERN_ERR @@ -334,6 +339,9 @@ static int dlpar_remove_vio_slot(char *d return -EINVAL; vio_unregister_device(vio_dev); + + put_device(&vio_dev->dev); + return 0; } Patches currently in stable-queue which might be from johan@kernel.org are queue-4.9/usb-serial-io_ti-fix-i-o-after-disconnect.patch queue-4.9/usb-serial-ti_usb_3410_5052-fix-null-deref-at-open.patch queue-4.9/usb-serial-kl5kusb105-abort-on-open-exception-path.patch queue-4.9/usb-serial-kobil_sct-fix-null-deref-in-write.patch queue-4.9/usb-serial-spcp8x5-fix-null-deref-at-open.patch queue-4.9/usb-serial-mos7720-fix-parallel-probe.patch queue-4.9/usb-phy-am335x-control-fix-device-and-of_node-leaks.patch queue-4.9/usb-serial-io_ti-bind-to-interface-after-fw-download.patch queue-4.9/usb-serial-cyberjack-fix-null-deref-at-open.patch queue-4.9/usb-serial-mos7720-fix-null-deref-at-open.patch queue-4.9/usb-serial-garmin_gps-fix-memory-leak-on-failed-urb-submit.patch queue-4.9/usb-serial-io_ti-fix-null-deref-at-open.patch queue-4.9/powerpc-pci-rpadlpar-fix-device-reference-leaks.patch queue-4.9/usb-serial-pl2303-fix-null-deref-at-open.patch queue-4.9/usb-serial-quatech2-fix-sleep-while-atomic-in-close.patch queue-4.9/usb-serial-iuu_phoenix-fix-null-deref-at-open.patch queue-4.9/usb-serial-oti6858-fix-null-deref-at-open.patch queue-4.9/usb-serial-io_edgeport-fix-null-deref-at-open.patch queue-4.9/usb-serial-mos7720-fix-parport-use-after-free-on-probe-errors.patch queue-4.9/usb-serial-mos7720-fix-use-after-free-on-probe-errors.patch queue-4.9/usb-serial-mos7840-fix-null-deref-at-open.patch queue-4.9/usb-serial-omninet-fix-null-derefs-at-open-and-disconnect.patch queue-4.9/usb-serial-keyspan_pda-verify-endpoints-at-probe.patch queue-4.9/usb-serial-io_ti-fix-another-null-deref-at-open.patch