From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-by2nam01on0059.outbound.protection.outlook.com ([104.47.34.59]:61443 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751231AbdFEDfb (ORCPT ); Sun, 4 Jun 2017 23:35:31 -0400 Date: Mon, 5 Jun 2017 11:35:30 +0800 From: Peter Chen To: Johan Hovold CC: Greg Kroah-Hartman , Linus Walleij , Peter Chen , Rob Herring , Arnd Bergmann , Sricharan R , Zhang Rui , Eduardo Valentin , , , , stable , Peter Chen Subject: Re: [PATCH 1/7] USB: core: fix device node leak Message-ID: <20170605033530.GA20014@b29397-desktop> References: <20170530162554.26159-1-johan@kernel.org> <20170530162554.26159-2-johan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20170530162554.26159-2-johan@kernel.org> Sender: stable-owner@vger.kernel.org List-ID: On Tue, May 30, 2017 at 06:25:48PM +0200, Johan Hovold wrote: > Make sure to release any OF device-node reference taken when creating > the USB device. > > Note that we currently do not hold a reference to the root hub > device-tree node (i.e. the parent controller node). > > Fixes: 69bec7259853 ("USB: core: let USB device know device node") > Cc: stable # v4.6 > Cc: Peter Chen > Signed-off-by: Johan Hovold > --- > drivers/usb/core/usb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c > index 28b053cacc90..62e1906bb2f3 100644 > --- a/drivers/usb/core/usb.c > +++ b/drivers/usb/core/usb.c > @@ -416,6 +416,8 @@ static void usb_release_dev(struct device *dev) > > usb_destroy_configuration(udev); > usb_release_bos_descriptor(udev); > + if (udev->parent) > + of_node_put(dev->of_node); > usb_put_hcd(hcd); > kfree(udev->product); > kfree(udev->manufacturer); Acked-by: Peter Chen -- Best Regards, Peter Chen