USB: ledtrig-usbport: fix of-node leak
authorJohan Hovold <johan@kernel.org>
Thu, 9 Nov 2017 17:07:22 +0000 (18:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Mar 2018 07:42:48 +0000 (08:42 +0100)
commit872181a79b3537aa3ce1b43891bd46d772f720ea
treeea8c8fce1a9567e59e9a9583114b5e574a540958
parentb9faab6a01e92a679968be32c19995a4851d0cae
USB: ledtrig-usbport: fix of-node leak

[ Upstream commit 03310a15484ab6a8f6d91bbf7fe486b17275c09a ]

This code looks up a USB device node from a given parent USB device but
never dropped its reference to the returned node.

As only the address of the node is used for a later matching, the
reference can be dropped immediately.

Note that this trigger implementation confuses the description of the
USB device connected to a port with the port itself (which does not have
a device-tree representation).

Fixes: 4f04c210d031 ("usb: core: read USB ports from DT in the usbport LED trigger driver")
Cc: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/ledtrig-usbport.c