Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1623310ybv; Fri, 21 Feb 2020 00:29:22 -0800 (PST) X-Google-Smtp-Source: APXvYqypVe2KmGv8zTZ+gIMSivI/xnZ1sXqtGP4ftNZtddWUuEFn01mNdr61ACYuESlO8yeI1hcx X-Received: by 2002:aca:48cd:: with SMTP id v196mr1071615oia.102.1582273762615; Fri, 21 Feb 2020 00:29:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273762; cv=none; d=google.com; s=arc-20160816; b=Dx0Pu4IH2Jimao44z9pkKl1vzgPz5aMlS648ZvYwt+G4Zx3Ti0ixyuv0IyJQE0AMo7 lWPLZbY9Xo0eFSjq06YioQzdn401w6wafSliGdiTXNv9g3MCU5OYeH8+hhOxUJePIH88 U5n7OB4uwsKDD/k43U8Pe3g0LaJw6Xq9+Cj+Q3f7v3/qkafD6D6FSZmEFbt8rK8XtpuI plnvG+aXvlEvnCL+vb6xKdqoSOYZ+C3nTbFXbpFlgKuSLY/OFEbnCqlDN0GvmLt0FRXQ z38+aoPmWlwRG4QBksNv8cK/lXWHP8bKos/3hvqEivnaCkihKUHvETZnquhYMb8wFLqQ 76sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xyGrd0o6ycRnTNZur+qV1O/weH3kzk/cSLkyR5TXMWo=; b=b0dfyzKYXDdyIPl7N/rZ1CWvrxrZtcSubRKI/j/wLdCjHcxNU8ODYx0NqjLnOAI99c rvzdDBPmfJkhxXW+6bKETKvnWuGJk3PmBPfHbwPajrPMykqrdbEPGVX8Mim4ttUQgku/ 0z9FKtGdHuOxNkCwetchN2fjlQedBVPZHbHRNkBEayidByAC3XShFS+Q7GqVFK7U3L98 d72QRWc4mq4ox4Z+xU9uZYOEZwOGBpq3Six43IvOe8zJihRwud3TpSYmp3yLr2UMxFF/ ncCqIPNlWsTAB6GiDTFS5+DpyPYPO++bbAduvMEgXIFFSyxUkWrzL4EQ8x7RPRrVdCuh fZ2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="kohuf9/l"; 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 t9si1018428otp.57.2020.02.21.00.29.10; Fri, 21 Feb 2020 00:29:22 -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; dkim=pass header.i=@kernel.org header.s=default header.b="kohuf9/l"; 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 S2388094AbgBUIUA (ORCPT + 99 others); Fri, 21 Feb 2020 03:20:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:58724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388085AbgBUITz (ORCPT ); Fri, 21 Feb 2020 03:19:55 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6368024694; Fri, 21 Feb 2020 08:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273194; bh=HsuiAuVjmyGRZWe1R+q2TUvEJVaGifg/AmwPAD21etU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kohuf9/lPGu9+9msoL5TaBUY3Y+5B9+XpsdwgJfUsTBk1+6N7RHUhGrPE8DUj15v1 uIqQwrfKQ0Qmfad1lQbQWXbrobQcTtyV9nO48f5rdNlOfx/SdZ3dAYsilsKvgfB9E9 JgD3B3tBH7v+R2Zc9Pdx8gveZzUOFwbOncSRHK7E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aditya Pakki , Kalle Valo , Sasha Levin Subject: [PATCH 4.19 079/191] orinoco: avoid assertion in case of NULL pointer Date: Fri, 21 Feb 2020 08:40:52 +0100 Message-Id: <20200221072300.728391700@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aditya Pakki [ Upstream commit c705f9fc6a1736dcf6ec01f8206707c108dca824 ] 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. Signed-off-by: Aditya Pakki Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c index 2c7dd2a7350c1..b704e4bce171d 100644 --- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c @@ -1364,7 +1364,8 @@ static int ezusb_init(struct hermes *hw) int retval; BUG_ON(in_interrupt()); - BUG_ON(!upriv); + if (!upriv) + return -EINVAL; upriv->reply_count = 0; /* Write the MAGIC number on the simulated registers to keep -- 2.20.1