Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4084935ybv; Tue, 25 Feb 2020 12:54:47 -0800 (PST) X-Google-Smtp-Source: APXvYqxk2CQRiBNjcftSdmTRdPxbajUifV0b59d3bl9e5jU/S4/FT5IQfuyLGUlwrMziC1sXFohU X-Received: by 2002:a9d:d0b:: with SMTP id 11mr355238oti.287.1582664087001; Tue, 25 Feb 2020 12:54:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582664086; cv=none; d=google.com; s=arc-20160816; b=FsFPHKt4bGZjOInHx2hvPwu0wMsUzWg/qnT5Sb6KrPTvbi4TA0Rflg3INBtY3E1Hck o8PfV7FGTMY1aFnoPXWCuF8ddKj98vBqUjRS3raRyKujnQqz8eEnwfDNrf35dY0He0Mo gp3JQgoPewk+OzUZj4CvkryebO0xv8kuYzsFEuj6IRVYB5Lf0a26FpoIy0ceOPRfjM+z bQcgLupVJHzLNe9UZqER51uB9yvYMskmGcEf+vXNtIWzlKe4KjP1tzBZGumM+DuDJ/Ei 4nZT3kcNrqohZTrXdZ9ZUrbBy9vpr/OaDA1Vx8qJ4m+jWlukrFfKz1EY+IByZAfwJ5lg 31xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=qbbi1nv4OdXbFx5+uayahyN01oMnPKFHh6u+kXo2f7E=; b=nhOQoQ+QZ/DYqilOI25TWwO1Nyiv2kJ4xWOyaRBWXMwBEHc/jsLdaH6Gdti9c8rwy+ PNhCnZMpB0Z7Kb3DE0fXJIpNF7Trx2vkjINjPaxa6FbfmCNniFhAvkOz3oldnwvxABk4 2geM5gWfhfWSkKhPExQ0P6BekzqlJ/MTwoI3z9WvtTlMBpu8vD0R0beUqUviDUXw9m2K qG53St4QbSiwu3M4zzzpFWNIpnb0lKvY6gANLsskgE4stcVmVyYoECC8FazJAXE6HgUs +1SJ4oW8mRHfdJAN6ZJf23024Fya8C7pXHMuzo7Ggv9Byyj8a1if7MBtP2s3Y/MylSAI xLzw== 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 e23si173546oie.105.2020.02.25.12.54.34; Tue, 25 Feb 2020 12:54:46 -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 S1729686AbgBYUyV (ORCPT + 99 others); Tue, 25 Feb 2020 15:54:21 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:39632 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728714AbgBYUyV (ORCPT ); Tue, 25 Feb 2020 15:54:21 -0500 Received: (qmail 6720 invoked by uid 2102); 25 Feb 2020 15:54:20 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 25 Feb 2020 15:54:20 -0500 Date: Tue, 25 Feb 2020 15:54:20 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Eugeniu Rosca cc: linux-usb@vger.kernel.org, , , Greg Kroah-Hartman , Thinh Nguyen , "Lee, Chiasheng" , Mathieu Malaterre , Kai-Heng Feng , Hardik Gajjar , , Eugeniu Rosca Subject: Re: [PATCH] usb: hub: Fix unhandled return value of usb_autopm_get_interface() In-Reply-To: <20200225202223.GA9154@lxhi-065.adit-jv.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 25 Feb 2020, Eugeniu Rosca wrote: > 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? If you prefer to split this up into multiple patches, that's fine with me. Alan Stern