Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4062150ybv; Tue, 25 Feb 2020 12:23:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwRWNyAzyGALNwvTo/99PMFTmuzJ6HO94f35K9RDpcsVpUXd63OkZObK/JI5f9UGSmm9J52 X-Received: by 2002:a9d:21c5:: with SMTP id s63mr291760otb.142.1582662204089; Tue, 25 Feb 2020 12:23:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582662204; cv=none; d=google.com; s=arc-20160816; b=p27+chWopp4mDXOJqlaNveOJd4t6dQLZwdPVid2Rz0O4+l4qYf33MId0vTagm0IK8S wjFWO/Dga/ttA9+v4dJwxKLsDIEMxCS/7BiBpHD8lL9dQ+bRznlwuRWRAPRogCjl0Dgd BW3Enfxsch+IlSHwSffyRE9YBt8YHVMYD2WTTJJUmUuW85ZOnatMZbZMo4rNaHrbWWH9 aBTkPAXAyFe3dAduqXoqql/067YlDlntuvC1A4kSFsa2sFcArtoYfrn4sIVtQxWXQqcf eP+k1VCrF2Vo2m16sIzC8HLRn1NJTW3Lk4lHMlf2CcpptW0SPpri5OuX0SUuwDUJ9+e+ QDjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=YwUQRV19xjCE37i50+0H2grav9LUg+Ve3PQSFQv2wJs=; b=ZB0BMvkbRFGD/3Aw2rwkESmoKjSB3zWOjfIAFF3Y5EHeBKjrJ6YdEH6v4D85JnDn+J P5SqEZq4vPe4Xyj80a65i7HsY8UdwZNeQMlo9HRGRXYSdeHTYQNi2GB/O6vPd9X3GNk8 ScJADRHuridYrNhg0sPBcVJcM+f6dJLCkCA3hE91R/mTPchdio836F72hsp9RJ2laNLU BTVIEO+JsLmKtqG7rK2JJfQPz7rdrsSvOyrf8eDprwChFiCaOYL+To9ulk1D6zquUIUg gv/u2mK6IBrQ5uGA2DfTKDum/LV4t7s7JjvOaLWw+BW6rj851hqMjUzhv3GZJgDRvBLD CnIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si173290otk.42.2020.02.25.12.23.12; Tue, 25 Feb 2020 12:23:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731751AbgBYUWf (ORCPT + 99 others); Tue, 25 Feb 2020 15:22:35 -0500 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:53946 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731565AbgBYUWe (ORCPT ); Tue, 25 Feb 2020 15:22:34 -0500 Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id 890913C009D; Tue, 25 Feb 2020 21:22:32 +0100 (CET) Received: from smtp1.de.adit-jv.com ([127.0.0.1]) by localhost (smtp1.de.adit-jv.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vydUNAF9Bs4E; Tue, 25 Feb 2020 21:22:26 +0100 (CET) Received: from HI2EXCH01.adit-jv.com (hi2exch01.adit-jv.com [10.72.92.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.de.adit-jv.com (Postfix) with ESMTPS id 824033C005E; Tue, 25 Feb 2020 21:22:26 +0100 (CET) Received: from lxhi-065.adit-jv.com (10.72.93.66) by HI2EXCH01.adit-jv.com (10.72.92.24) with Microsoft SMTP Server (TLS) id 14.3.468.0; Tue, 25 Feb 2020 21:22:26 +0100 Date: Tue, 25 Feb 2020 21:22:23 +0100 From: Eugeniu Rosca To: Alan Stern CC: , , , Greg Kroah-Hartman , Thinh Nguyen , "Lee, Chiasheng" , Mathieu Malaterre , Kai-Heng Feng , Hardik Gajjar , , Eugeniu Rosca , Eugeniu Rosca Subject: Re: [PATCH] usb: hub: Fix unhandled return value of usb_autopm_get_interface() Message-ID: <20200225202223.GA9154@lxhi-065.adit-jv.com> References: <20200225191241.GA32410@lxhi-065.adit-jv.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.72.93.66] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alan, On Tue, Feb 25, 2020 at 02:39:23PM -0500, Alan Stern wrote: > On Tue, 25 Feb 2020, Eugeniu Rosca wrote: > > [1] (v5.6-rc3) git grep -En "[^=]\s+usb_autopm_get_interface\(" > > drivers/input/touchscreen/usbtouchscreen.c:1788: usb_autopm_get_interface(intf); > > drivers/media/usb/stkwebcam/stk-webcam.c:628: usb_autopm_get_interface(dev->interface); > > drivers/net/usb/hso.c:1308: usb_autopm_get_interface(serial->parent->interface); > > drivers/net/usb/r8152.c:5231: usb_autopm_get_interface(tp->intf); > > sound/usb/usx2y/us122l.c:192: usb_autopm_get_interface(iface); > > Your regular expression isn't right because it doesn't match lines > where the usb_autopm_get_interface() is preceded only by one whitespace > character (i.e., a tab). It also will match lines where there are two > space characters between the = sign and the function name. I think > what you want is more like "(^|[^=[:space:]])\s*" at the start of the > RE. Agreed. My version filters out some true positives. > > A revised search finds line 997 in drivers/usb/core/hub.c and lines > 216, 269 in drivers/usb/core/port.c. (I didn't try looking in any > other directories.) AFAICT all three of these should check the return > value, although a error message in the kernel log probably isn't > needed. > > Do you want to fix those instances up also, maybe merging them in with > the existing patch? I wonder if squashing all these fixes into one patch is the best option. There are three commits fixed by the proposed changes in usb core: - v5.6-rc3 commit 1208f9e1d758c9 ("USB: hub: Fix the broken detection of USB3 device in SMSC hub") - v3.9-rc1 commit 971fcd492cebf5 ("usb: add runtime pm support for usb port device") - v2.6.33-rc1 commit 253e05724f9230 ("USB: add a "remove hardware" sysfs attribute") I assume a single fix will create some pain when applying it to the stable branches. Do you have any preference/inputs about that? -- Best Regards Eugeniu Rosca