Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3504045ybv; Tue, 25 Feb 2020 02:30:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzlW+F0MrOs/YacnLiImp6D72QnGzIKDI+e7eFJHyDFiRudjtPrJTIEmymuHBM6NJZm2hN6 X-Received: by 2002:a05:6808:218:: with SMTP id l24mr318125oie.108.1582626627051; Tue, 25 Feb 2020 02:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582626627; cv=none; d=google.com; s=arc-20160816; b=QP3bR6YimN72RGMJv2XQhW9VCU4IGZokpl5oMMZnH7erGtofV/FdIKF4qRxzK0X9En lAlRIt4FuT2g2PZAYTC47gO3EYEnwNlgeBXBTi1oCsq7nS5a1JXDdXKJmZVp9SpyiKU+ dm5jUGhvEcFD2uW/rM2Bg6JFf/reOR43udWqkJQoTSzdz42xYFnMyM6JuJNpvM4NQ+qr Lghsj87eT+0MkNmWDBoJdOCHrHgAvT5cslMNAKeb/3X/XMlZavScrp2c5DGrPDUbsfGU C1jbi9OcLv7X8FJKPQi8/ojk2mp810SCodGnkY+U2D1WDzd09F4958RQYglk00oaMZQS 5qBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=UF3qUT9KqcNYmyUSgg89s4xIotjE7GmxWc7+0llTTlM=; b=N4knXwa7ZWlBjHLz5UI779Wh1fnu6NqN02GrC1R3XRHM4Fhj4TxI33QrF3DGLf9t3Q lqOyxwjRwQiFs1yC4wHNaACnEwUNt1QvNiC+2HeECD5H7+Wsa0v8nwuHzLg+/MIPe8rD wEuCke8ANv+T+6XUW5it530NuQOik3nKzUpGW0AmDVAsubIYzYfAcfN2HmRGWwRDn9YE Xpt3doDOq3ptI0jFso+GEXD66B0oJJI7uDZV8Z+wdRU2m4EZ9aU8o+FvM+gQgzJJFOiT zLMONA9LMk0zkTkrpSGmIAI7M1wSa5oYgYqhWZezT5hRnpwrLuNgH6WMISR9KuuZR5U0 TNNg== 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 r3si7397052otp.292.2020.02.25.02.30.14; Tue, 25 Feb 2020 02:30:27 -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 S1730289AbgBYK2M (ORCPT + 99 others); Tue, 25 Feb 2020 05:28:12 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:39558 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730175AbgBYK2M (ORCPT ); Tue, 25 Feb 2020 05:28:12 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 6237F1C0411; Tue, 25 Feb 2020 11:28:10 +0100 (CET) Date: Tue, 25 Feb 2020 11:28:09 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Aditya Pakki , Kalle Valo , Sasha Levin Subject: Re: [PATCH 4.19 079/191] orinoco: avoid assertion in case of NULL pointer Message-ID: <20200225102809.GA2591@amd> References: <20200221072250.732482588@linuxfoundation.org> <20200221072300.728391700@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline In-Reply-To: <20200221072300.728391700@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Aditya Pakki >=20 > [ Upstream commit c705f9fc6a1736dcf6ec01f8206707c108dca824 ] >=20 > In ezusb_init, if upriv is NULL, the code crashes. However, the caller > in ezusb_probe can handle the error and print the failure message. > The patch replaces the BUG_ON call to error return. The caller already checked that upriv is not NULL, AFAICT. priv =3D alloc_orinocodev(sizeof(*upriv), &udev->dev, ezusb_hard_reset, NULL); if (!priv) { err("Couldn't allocate orinocodev"); retval =3D -ENOMEM; goto exit; } =20 I don't see this as an improvement. Best regards, Pavel =09 > +++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c > @@ -1364,7 +1364,8 @@ static int ezusb_init(struct hermes *hw) > int retval; > =20 > BUG_ON(in_interrupt()); > - BUG_ON(!upriv); > + if (!upriv) > + return -EINVAL; > =20 > upriv->reply_count =3D 0; > /* Write the MAGIC number on the simulated registers to keep --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --IJpNTDwzlM2Ie8A6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl5U9rkACgkQMOfwapXb+vKmjQCgwzqrB0WO/uxLdAnnaigxtoxo tcwAn1E7yollUJFJJh4qsgtVH6WaXjZX =dz+r -----END PGP SIGNATURE----- --IJpNTDwzlM2Ie8A6--