From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42624 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759294AbdAILOb (ORCPT ); Mon, 9 Jan 2017 06:14:31 -0500 Subject: Patch "USB: phy: am335x-control: fix device and of_node leaks" has been added to the 4.4-stable tree To: johan@kernel.org, b-liu@ti.com, felipe.balbi@linux.intel.com, gregkh@linuxfoundation.org Cc: , From: Date: Mon, 09 Jan 2017 12:14:30 +0100 Message-ID: <148396047021214@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 USB: phy: am335x-control: fix device and of_node leaks to the 4.4-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: usb-phy-am335x-control-fix-device-and-of_node-leaks.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 015105b12183556771e111e93f5266851e7c5582 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 1 Nov 2016 11:40:25 +0100 Subject: USB: phy: am335x-control: fix device and of_node leaks From: Johan Hovold commit 015105b12183556771e111e93f5266851e7c5582 upstream. Make sure to drop the references taken by of_parse_phandle() and bus_find_device() before returning from am335x_get_phy_control(). Note that there is no guarantee that the devres-managed struct phy_control will be valid for the lifetime of the sibling phy device regardless of this change. Fixes: 3bb869c8b3f1 ("usb: phy: Add AM335x PHY driver") Acked-by: Bin Liu Signed-off-by: Johan Hovold Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/phy/phy-am335x-control.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/phy/phy-am335x-control.c +++ b/drivers/usb/phy/phy-am335x-control.c @@ -126,10 +126,12 @@ struct phy_control *am335x_get_phy_contr return NULL; dev = bus_find_device(&platform_bus_type, NULL, node, match); + of_node_put(node); if (!dev) return NULL; ctrl_usb = dev_get_drvdata(dev); + put_device(dev); if (!ctrl_usb) return NULL; return &ctrl_usb->phy_ctrl; Patches currently in stable-queue which might be from johan@kernel.org are queue-4.4/usb-serial-io_ti-fix-i-o-after-disconnect.patch queue-4.4/usb-serial-ti_usb_3410_5052-fix-null-deref-at-open.patch queue-4.4/usb-serial-kl5kusb105-abort-on-open-exception-path.patch queue-4.4/usb-serial-kobil_sct-fix-null-deref-in-write.patch queue-4.4/usb-serial-spcp8x5-fix-null-deref-at-open.patch queue-4.4/usb-serial-mos7720-fix-parallel-probe.patch queue-4.4/usb-phy-am335x-control-fix-device-and-of_node-leaks.patch queue-4.4/usb-serial-io_ti-bind-to-interface-after-fw-download.patch queue-4.4/usb-serial-cyberjack-fix-null-deref-at-open.patch queue-4.4/usb-serial-mos7720-fix-null-deref-at-open.patch queue-4.4/usb-serial-garmin_gps-fix-memory-leak-on-failed-urb-submit.patch queue-4.4/usb-serial-io_ti-fix-null-deref-at-open.patch queue-4.4/usb-serial-pl2303-fix-null-deref-at-open.patch queue-4.4/usb-serial-quatech2-fix-sleep-while-atomic-in-close.patch queue-4.4/usb-serial-iuu_phoenix-fix-null-deref-at-open.patch queue-4.4/usb-serial-oti6858-fix-null-deref-at-open.patch queue-4.4/usb-serial-io_edgeport-fix-null-deref-at-open.patch queue-4.4/usb-serial-mos7720-fix-parport-use-after-free-on-probe-errors.patch queue-4.4/usb-serial-mos7720-fix-use-after-free-on-probe-errors.patch queue-4.4/usb-serial-mos7840-fix-null-deref-at-open.patch queue-4.4/usb-serial-omninet-fix-null-derefs-at-open-and-disconnect.patch queue-4.4/usb-serial-keyspan_pda-verify-endpoints-at-probe.patch queue-4.4/usb-serial-io_ti-fix-another-null-deref-at-open.patch