From patchwork Thu Jan 16 23:17:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233701 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,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 DD0D3C33CB3 for ; Thu, 16 Jan 2020 23:44:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2B7C20748 for ; Thu, 16 Jan 2020 23:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579218294; bh=RaIv+XEgZLtzNRzIDMIJ555wufoJzqan9BfDFdy6l1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1YqnXg1Vgda0BcQiU3hy1Vn3A2A64ArH4dr3VBA+VVmwGUfvTuR6V3lriXfVi9uf3 ogMW6inPfC/yfPLS1VbWWKdOy2pFt++E/iEWDoiS7qNgUZqzOcazdFv7L+fjTHpHRB xcbsesB6J+9U9CJI4J8ugc+vDsGCJWP7AbvCm3Ak= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729279AbgAPXou (ORCPT ); Thu, 16 Jan 2020 18:44:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:52388 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730219AbgAPXXq (ORCPT ); Thu, 16 Jan 2020 18:23:46 -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 1E4022072B; Thu, 16 Jan 2020 23:23:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217025; bh=RaIv+XEgZLtzNRzIDMIJ555wufoJzqan9BfDFdy6l1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PX6StUS3MkG5IZYaT9MfneqxY8HejQJU2//nizVij3OOWixVvxjrY32Ny6YDlGlRn +MqC1gqZFf0z2xcBCCiajyHV14C47z2V8/hw8kQ+2zFMGrn1aQShCvH4EfLpH4dUpn 3w6lJTnjIb1qQ5QIau+qK4DGtnmhrDUmT7u2zTJc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amitkumar Karwar , Siva Rebbagondla , Kalle Valo , Denis Efremov Subject: [PATCH 5.4 117/203] rsi: fix potential null dereference in rsi_probe() Date: Fri, 17 Jan 2020 00:17:14 +0100 Message-Id: <20200116231755.604943633@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@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: Denis Efremov commit f170d44bc4ec2feae5f6206980e7ae7fbf0432a0 upstream. The id pointer can be NULL in rsi_probe(). It is checked everywhere except for the else branch in the idProduct condition. The patch adds NULL check before the id dereference in the rsi_dbg() call. Fixes: 54fdb318c111 ("rsi: add new device model for 9116") Cc: Amitkumar Karwar Cc: Siva Rebbagondla Cc: Kalle Valo Signed-off-by: Denis Efremov Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -793,7 +793,7 @@ static int rsi_probe(struct usb_interfac adapter->device_model = RSI_DEV_9116; } else { rsi_dbg(ERR_ZONE, "%s: Unsupported RSI device id 0x%x\n", - __func__, id->idProduct); + __func__, id ? id->idProduct : 0x0); goto err1; }