Skip to contentSkip to conversation

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

PATCH [email protected] 1 participant 1 message Jan 9, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]> know about it.

Quoted 1 line

From 015105b12183556771e111e93f5266851e7c5582 Mon Sep 17 00:00:00 2001

From: Johan Hovold <[email protected]>
Date: Tue, 1 Nov 2016 11:40:25 +0100
Subject: USB: phy: am335x-control: fix device and of_node leaks

From: Johan Hovold <[email protected]>

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")
---
 drivers/usb/phy/phy-am335x-control.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/usb/phy/phy-am335x-control.c +2 -0
@@ -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 [email protected] 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