Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1067232ybn; Wed, 2 Oct 2019 10:19:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/GjVU2ZUSd8Vds2052TwuLwYe/RExUxe8T5AXPN2EOWoOsW+c4MUgu13TU4XNRgA4oqLX X-Received: by 2002:a50:cd1a:: with SMTP id z26mr4914786edi.75.1570036781567; Wed, 02 Oct 2019 10:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570036781; cv=none; d=google.com; s=arc-20160816; b=MjjBRmQHPrhLhRJYw5gfrAssW/qA2aG3qlsPjXs8WrEwkE7bBJsFS85DA2bEA7dJJb iJ6svy1tW24puIhluzU2THiB9UYWJX4lyn8yuOG3a7F9D3kd+gQuS4i/LyOTDa66yg4/ rRmbEJ68lnSNZnRYYvmeLwjwzSGuJ9EW7+sNDoaipEjLwAexOUR2yuyWx9Vx9CncdUPu dI9mQ9rLVzHk9HwyxqVVL5fLVr3YlE3qetq/B0p1Uj8xp0cacaMV1Iwg6sGtcxqtveUs RYUD6kjda+orUr6ATMTJkdYWuo9dm4R5hOinsNqfdVkzmdAE+hNohlYAfzMhfXjPwuyE xgWA== 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 :message-id:date:subject:cc:to:from; bh=BV6L+hqk4XyUS3SFdDC/o0QqOdSd75QbKfMgEhSqMZk=; b=M1fBzvXAxL1iQwrOWGygROisiMFEGM4zRKEOZ41cfIND3nRmXUnZEmaysTWBwd8HBH /5VpbTCRvnek2tYum6qRJin6MY2ScJ5/R0FlPLEWVEbl/Xhr+22g3+7iBl7KPX2liWmY WuoUNWKCJWr5u9RMxqGMHL21ZO7jrgPZjeXcEY3Z4Kpq9dRtzno+DEl+eg6ALiiCpf8a THme5VHvzyKnG/jENhR2oK3GCvTC1ok4rEypHcjDXC25tYcH+87lkee2z9rc+7E18ifZ /ZUwYEcfTJX2AvMyXdZOj8IXy4sNGyNMGqUqWr5ibHJD8RQduyhgx1Xtaz2stgiCwEiu ajzQ== 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 jr6si6062750ejb.307.2019.10.02.10.19.16; Wed, 02 Oct 2019 10:19:41 -0700 (PDT) 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 S1728616AbfJBRSb (ORCPT + 99 others); Wed, 2 Oct 2019 13:18:31 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37695 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728145AbfJBRSa (ORCPT ); Wed, 2 Oct 2019 13:18:30 -0400 Received: by mail-wm1-f65.google.com with SMTP id f22so7779498wmc.2; Wed, 02 Oct 2019 10:18:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BV6L+hqk4XyUS3SFdDC/o0QqOdSd75QbKfMgEhSqMZk=; b=QPnQjoVRc9XWitabtC+modVMCOV0bDKc/xLUe34HxD+QsKRGVsbl61I0nr5W74fz6A MBp9Y+hJScDUrmrhVsN87QLHk9EbwI2ds8NuFeq6XOvbN5ZNJRimL0Pj/SluMpXfiOxe nH09w8hZRIlRuamkBQM17CxZu1cXi9dIFGSnUthAxujeMkJNHts6t65gw9Pi+ulqCFHV +oGi9IkE48+YjjB1NduiP0dwrsR1z9nJpOUI3FRM4m4/fRwZHY9GhiX3GLkcEPrWmYF8 odiqL9s8XP/TJ4gFA7dgDvqAU6R71ND/m6HRMSMyi/6xrtlrMhv5bH39T5FKUvPAwAzN BhlQ== X-Gm-Message-State: APjAAAWGRPtFvsu3xcdqXfuMbZG4q1Xm22ERdCeFXYQUSbrTAnwowL65 xNTGuPUg674IcQuPMYnfYNVnDlYY1b8= X-Received: by 2002:a1c:1f47:: with SMTP id f68mr4015480wmf.78.1570036706910; Wed, 02 Oct 2019 10:18:26 -0700 (PDT) Received: from green.intra.ispras.ru (bran.ispras.ru. [83.149.199.196]) by smtp.googlemail.com with ESMTPSA id y8sm20691987wrm.64.2019.10.02.10.18.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 10:18:26 -0700 (PDT) From: Denis Efremov To: linux-wireless@vger.kernel.org Cc: Denis Efremov , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Amitkumar Karwar , Siva Rebbagondla , Kalle Valo Subject: [PATCH] rsi: fix potential null dereference in rsi_probe() Date: Wed, 2 Oct 2019 20:18:11 +0300 Message-Id: <20191002171811.23993-1-efremov@linux.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index 760eaffeebd6..23a1d00b5f38 100644 --- 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_interface *pfunction, 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; } -- 2.21.0