Patch "uwb: fix device reference leaks" has been added to the 4.4-stable tree
This is a note to let you know that I've just added the patch titled
uwb: fix device reference 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:
uwb-fix-device-reference-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
d6124b409ca33c100170ffde51cd8dff761454a1Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Tue, 1 Nov 2016 12:13:31 +0100
Subject: uwb: fix device reference leaks
From: Johan Hovold <[email protected]>
commit d6124b409ca33c100170ffde51cd8dff761454a1 upstream.
This subsystem consistently fails to drop the device reference taken by class_find_device().
Note that some of these lookup functions already take a reference to the returned data, while others claim no reference is needed (or does not seem need one).
--- drivers/uwb/lc-rc.c | 16 +++++++++++++--- drivers/uwb/pal.c | 2 ++ 2 files changed, 15 insertions(+), 3 deletions(-)
drivers/uwb/lc-rc.c +13 -3
@@ -56,8 +56,11 @@ static struct uwb_rc *uwb_rc_find_by_indstruct uwb_rc *rc =NULL ; dev =class_find_device (&uwb_rc_class,NULL , &index, uwb_rc_index_match); -if (dev) +if (dev) { rc =dev_get_drvdata (dev); +put_device (dev); + } +return rc; }
@@ -467,7 +470,9 @@ struct uwb_rc *__uwb_rc_try_get(struct uif (dev) { rc =dev_get_drvdata (dev);__uwb_rc_get (rc); +put_device (dev); } +return rc; }EXPORT_SYMBOL_GPL (__uwb_rc_try_get);
@@ -520,8 +525,11 @@ struct uwb_rc *uwb_rc_get_by_grandpa(con dev =class_find_device (&uwb_rc_class,NULL , grandpa_dev, find_rc_grandpa); -if (dev) +if (dev) { rc =dev_get_drvdata (dev); +put_device (dev); + } +return rc; }EXPORT_SYMBOL_GPL (uwb_rc_get_by_grandpa);
@@ -553,8 +561,10 @@ struct uwb_rc *uwb_rc_get_by_dev(const sstruct uwb_rc *rc =NULL ; dev =class_find_device (&uwb_rc_class,NULL , addr, find_rc_dev); -if (dev) +if (dev) { rc =dev_get_drvdata (dev); +put_device (dev); + }return rc; }
drivers/uwb/pal.c +2 -0
@@ -97,6 +97,8 @@ static bool uwb_rc_class_device_exists(s dev =class_find_device (&uwb_rc_class,NULL , target_rc, find_rc); +put_device (dev); +return (dev !=NULL ); }
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/mfd-core-fix-device-reference-leak-in-mfd_clone_cell.patch queue-4.4/pm-sleep-fix-device-reference-leak-in-test_suspend.patch queue-4.4/uwb-fix-device-reference-leaks.patch