From patchwork Fri Feb 21 07:40:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 230827 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77F8CC35641 for ; Fri, 21 Feb 2020 08:28:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4627A24670 for ; Fri, 21 Feb 2020 08:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273719; bh=HsuiAuVjmyGRZWe1R+q2TUvEJVaGifg/AmwPAD21etU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Z7NIByCkzBQcH5VNdvvAOxlzj1534zpSP7W893P6q68BHlNopeLdGYa8p4rTSJATL 0wCuVVaG7xp8ifuWTXlBOFZ/k1OhTnaU37yWC60oQW/yVd3zLyqMRxu27XA6XUTdfi /n993yxFV88lZQaSn1nONBwlmdAZu5boz8cbnQJs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387810AbgBUIT6 (ORCPT ); Fri, 21 Feb 2020 03:19:58 -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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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