Patch "USB: phy: am335x-control: fix device and of_node leaks" has been added to the 4.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.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:
     usb-phy-am335x-control-fix-device-and-of_node-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 <stable@xxxxxxxxxxxxxxx> know about it.


>From 015105b12183556771e111e93f5266851e7c5582 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@xxxxxxxxxx>
Date: Tue, 1 Nov 2016 11:40:25 +0100
Subject: USB: phy: am335x-control: fix device and of_node leaks

From: Johan Hovold <johan@xxxxxxxxxx>

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 <b-liu@xxxxxx>
Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 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
@@ -134,10 +134,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@xxxxxxxxxx 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/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
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]