Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751294AbdFEDfl (ORCPT ); Sun, 4 Jun 2017 23:35:41 -0400 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 Authentication-Results: spf=softfail (sender IP is 192.88.158.2) smtp.mailfrom=gmail.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=gmail.com; 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> User-Agent: Mutt/1.5.24 (2015-08-30) X-EOPAttributedMessage: 0 X-Matching-Connectors: 131411073293709312;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.158.2;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(336005)(39410400002)(39380400002)(39850400002)(39860400002)(39400400002)(39840400002)(39450400003)(2980300002)(189002)(24454002)(199003)(9170700003)(189998001)(4001350100001)(6260500002)(229853002)(33716001)(105596002)(106466001)(23726003)(1076002)(2950100002)(6916009)(2906002)(87572001)(76176999)(54356999)(50986999)(86362001)(83506001)(7416002)(47776003)(6666003)(82202002)(5660300001)(305945005)(104016004)(50466002)(33656002)(8656002)(55016002)(54906002)(110136004)(9686003)(6246003)(53936002)(97756001)(73392002)(73972006)(46406003)(81442002)(39060400002)(4326008)(76482006)(77096006)(498600001)(356003)(38730400002)(81166006)(83322999)(8676002)(8936002)(18370500001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB2565;H:az84smr01.freescale.net;FPR:;SPF:SoftFail;MLV:ovrnspm;MX:1;A:1;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD001;1:3j75gW9iyXx2kHGQor7yVBj+k1JHu5bRLFSLWaym2klxGmtJTMJ3dzKSmaUJ41gABTaTOl7h/RK+Z9vMXxmwz3BPUCFLY9s8U+yNsauQMbzen+ar7ns1C1bBd40RTCKjIPSjSzeKly0SYlzyYNHsbQ8vIq+enxN92frCsHr3pvTGc2zkolOBL1HGurkXSB3GC304ijMsJMlZjLqtIfBXXR+FpR1V1HeE9okGhW/G9a3FHHTkoA/TFhKQk5uU+njm73sEmG2BI9J9oEokBRDT8xs5JZqXDB/fT0xkIAK8KnTcIDpaDWttN5t9566NQ9ZZ8rbDLkFc6X521KvpkpLYnQFhmaBXIvBu40LZFhGjr9LdiFJH+aym+oDs77PiUgBfvDahTsAOR8Fsa5WY5kNqNYi3nQYihdT23l7BRCK85KmGj1vdMTZFE6VyK3Q9GjABeuJL/HYsvdsmIjd7efD2V9WjUoEWDktRs5yEftukXwEQyFaurRHBa4F32SNAJMkVNggQSE4FYWUNUZjMuL5xMF7Qi2sNIn7TKO4iq2PoGLzTTRBIAoyh1xD0oCX1ylgCntxwrZHAwqovac4mULYBT31fPcdwUON1reF4rbIXcyA= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR03MB2565: X-MS-Office365-Filtering-Correlation-Id: b6491a7d-6c6f-4a06-64f8-08d4abc3e99d X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131430075)(201703131517081);SRVR:CY4PR03MB2565; X-Microsoft-Exchange-Diagnostics: 1;CY4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7RpoQ+8Bs0L/vRotINV1NTuFVFeYy2++WB2ceIHbCyBpAANYMZB4QcS/2ZRqGUip8eBIfHGYeOxHaUICfSUvnyU70vBAUg3z9inZzdMWfkwnk4uSfsnWHKr7kyqoe1RBhSaozhCXfm3BAiihXv6QDsxDKEuduUF/qniSh1czQmKTqhfhKh1RU40gjav2Ca1BqyVPlk1cKRc0Z4hkaA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(13016025)(8121501046)(5005006)(93006095)(93001095)(3002001)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123556025)(20161123561025)(20161123563025)(20161123565025)(20161123559100)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR03MB2565;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR03MB2565; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR03MB2565;4:ZANjHLQoVU90OyZRyQnbBDCN04eBp5zzw+5auZON6c?= =?us-ascii?Q?MrGMJYH/4k13gNEe5fn8Ooi7xVhKm3c4ivG4t8hgU6uKBukzCBfdiAq3dCKg?= =?us-ascii?Q?Gkbj2lXVrHzRhyO9+qVsJchuI4Fk1wC1cihLOaqDDPFvA9uUpx6PCA8Y/awh?= =?us-ascii?Q?F1pEMXDEoO1l6u4CVxoQF2q9Tkrz/uHPg3ze5qmVu0lyhvuFgKS9lJRH6Kll?= =?us-ascii?Q?hNzWJFJb498Ihm+eh8W0FfNvHr1zzN/rl7qwseQgwjSBtwNlqyWCVI0WAcqx?= =?us-ascii?Q?uCRAv2Fui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SpP63M/O06a?= =?us-ascii?Q?2lsH7riUTaYILraLHwjya0YDSYKOaHLxAh6Nk5hZpyerS83L4IBAujJcPLaN?= =?us-ascii?Q?5nfvjcQNg3/cy/G2fRfda0m/nNXWZ4UdZiDgpE+GoDYDXujGIRU9pEgHGJ2A?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 0329B15C8A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR03MB2565;23:UFbHSkYCTuiGl0tuQx2PwS5bL5o/LgFs5XyK6jHr7?= =?us-ascii?Q?lvAG9NJvczxX0rJKqtu8mKEZlll0fXmtEXnTrnIgPIvOckmjy4wkG7FIVWGn?= =?us-ascii?Q?jg86J8bPnbeG07+21wzv4BUeQbDtilXJQZBgURNzlwqf909SVIIilwrI6CK4?= =?us-ascii?Q?JkGtYROnRVW1CjMOnSjkW1X2ag4byAj/99op/ydYZdplNyuq/EM2V0vQVH1R?= =?us-ascii?Q?U2z+WBH4gmW1nJkntoJZvYdC+37XKLiTkDgsMQ8rFZTnycqb8pdU0v6VnF67?= =?us-ascii?Q?2Tqda+6Ez/qtk+QbtEHTSPgDk+3m0PaSEr4o56ATiYg/2/g86h9rnGeAghjO?= =?us-ascii?Q?c4n2gaBN4U8mNWRIR+d+P7i/ej7knVp4q5umTVSLrW1RvaE3o6PjZYyQXPiq?= =?us-ascii?Q?WJymRtTVga83oAlEF7gPQ5DEQz6ZlMa/ywZ8t9DYZ0zMWcQYl40Gz9enASa8?= =?us-ascii?Q?7kqlZ6e5Ewjwd4/ewEEpUroKE8UEI2pXlLcSXrq2ssnTNPQeEyWdvGlsMhjH?= =?us-ascii?Q?bWy0LSjVOvKDLfrNrM388B7/4LAGh1sB5bU8ykxo/iDXUAb0Lwsq8EVupIk3?= =?us-ascii?Q?/eZTdH0MyFQMWYmWnTwH59WSH8WwTPGX5yFsb/+H/qvDX/GLf+DALd44GXko?= =?us-ascii?Q?30wengBsqUp17MOXQ3GB27Y6BwcbEWCzWV3/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qdZBExt9g4SxFUwORAaOLl+/K3AHFRh8Edo84ErQxOCMyXg6UYPthTU0yjFsGOe++JmYycnDn+vuxwG68xIUjQ==;24:r2EewfOnY1slrForNAwMb72eDlZlNXrAI6zwYW2zh/MAe/HDOE/UtG7YM7JjoTNrxSs5gRiYIQdrVp0lNJ/docDlzfoauFT7wDD6mDKytoY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2565;7:RwQIb1kA2Ogkbo0MnaLnI32gwmBGj+Bf4suCdMSjb/43JeS4NSlV8ofPg5Y3VDRWKQY9k4ag9rzx5RwubYilKV5YtKGK7Qm/tELf+NwcQOFt2A/+B1kqFYbnYg5TBf0HnJqyE5qI1/uRCe/e2iuhxO2Zh0X1AGnkyHwmuZmMG+twVR4n1dfzFk5LOKxwMwLxpYe24TuCsiSr/agCoGiclU5eri4cGbNHSHkWteFN7eiMxPYocBbJcJWPcYP+yeRvueo1m6bqHY/XOmnMBDtgGVDYAo5Z8G9E/DJTYjJym+blSOlKku59j1XVkwIAFwRXAEseW24IN8xBmPyjtj1Fxg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2017 03:35:29.1057 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2565 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1078 Lines: 35 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