From patchwork Fri Oct 4 14:44:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11174711 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC2D31599 for ; Fri, 4 Oct 2019 14:46:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA90A215EA for ; Fri, 4 Oct 2019 14:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570200361; bh=Kp7VuvFTRPVIoBYiwjPrQ0tTuFh0qAbFY/3e2efh+gA=; h=From:To:Cc:Subject:Date:List-ID:From; b=Un1w7zcnNoUUkXyCGo1YJQzp5zmLy7N4YmB/Xuj/LrclmyUVGfw0GwYCT1USjtTuE 6xJXhg8cgvyBq4i5fi5OwSeNiNy8VBsGrWUTV0bXbEXjX3nZ7l1348/4vkt50eaXfR aX3RVhmm8QXvlezcwsI5Of2j/90Rezkc20epdB+c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389372AbfJDOpx (ORCPT ); Fri, 4 Oct 2019 10:45:53 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:37077 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389136AbfJDOpw (ORCPT ); Fri, 4 Oct 2019 10:45:52 -0400 Received: by mail-lf1-f65.google.com with SMTP id w67so4681330lff.4; Fri, 04 Oct 2019 07:45:50 -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=41QFKhTKVw0r48ZhA+a3ExQuzLOYbcSClKQP6ZHYplY=; b=NaCJdxmirxyJP/KpxD50qItbwZDFQIlUdsA5gju1LjFOBei/0mpmX24PiLKH4+jHZt Jr5lZ/2/B+mafNMIzNw1eTNGV/Bk2E5AcohEw9J0ViJ93Lzy42uOL13G54n4+YCrdbxz NsRCslGUZGhT+Ccf6F0kQK27WHVbkj8n9MrFJuXxNof5kJdD8n09sTt46FPd9ekwRSf/ VjpZxorAFTi9PVu5cBB9VfdwirMAJGd6xoQjbUkrwUTnYYLXdSsWGGgpPODj3WT7q6Ka GQ0mlV4T4rqCagbvyP6yUA+S2S6d9WhONmvvsLMp5JFtdTf30qsnmT6/yjy0w5S9Blh0 CiUA== X-Gm-Message-State: APjAAAWCL63Z3nM7htbpoz59iyIpn96mK9tl7gnic6pKO6mPgJsogP8w H6/P0rhkxHSAfF9Y/76WIEEsx3k5 X-Google-Smtp-Source: APXvYqwoyp2pDz11DUVf5PxE3ytN1hgT396kAmXEEpx4FfU2SPT2GaaBEfvO/egu9MZI9T25qQkHRA== X-Received: by 2002:a19:710c:: with SMTP id m12mr9438052lfc.41.1570200349750; Fri, 04 Oct 2019 07:45:49 -0700 (PDT) Received: from xi.terra (c-51f1e055.07-184-6d6c6d4.bbcust.telenor.se. [85.224.241.81]) by smtp.gmail.com with ESMTPSA id g3sm1326422ljj.59.2019.10.04.07.45.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Oct 2019 07:45:48 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.2) (envelope-from ) id 1iGOqG-0005V1-1n; Fri, 04 Oct 2019 16:46:00 +0200 From: Johan Hovold To: Kalle Valo Cc: Amitkumar Karwar , Siva Rebbagondla , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Denis Efremov , Johan Hovold Subject: [PATCH 1/2] Revert "rsi: fix potential null dereference in rsi_probe()" Date: Fri, 4 Oct 2019 16:44:21 +0200 Message-Id: <20191004144422.13003-1-johan@kernel.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This reverts commit f170d44bc4ec2feae5f6206980e7ae7fbf0432a0. USB core will never call a USB-driver probe function with a NULL device-id pointer. Reverting before removing the existing checks in order to document this and prevent the offending commit from being "autoselected" for stable. Signed-off-by: Johan Hovold --- 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 23a1d00b5f38..760eaffeebd6 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 ? id->idProduct : 0x0); + __func__, id->idProduct); goto err1; } From patchwork Fri Oct 4 14:44:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11174713 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF7571920 for ; Fri, 4 Oct 2019 14:46:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ADF8E215EA for ; Fri, 4 Oct 2019 14:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570200365; bh=CcEMd2zrAC7dSg1yN4pQ2s8bWxDo6bsUeX4SBbwWCHY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZHhrVkwTgkKemSyIfQpHcDN1xq4PZ2DuOcF9hHelYzM4l50HL60iw5QG9sr5QJ3Gb dE2+0PWJOWE/BeRVcTs8wlIYGBemdiUMs/FriyyQwpu30SJ3T50x5hFaUSXLMWrpHs vOtuc3Qb8jyJ5deNDmEl+HlObmuYYlB3ZWYG//tU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389253AbfJDOpv (ORCPT ); Fri, 4 Oct 2019 10:45:51 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:39005 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389042AbfJDOpv (ORCPT ); Fri, 4 Oct 2019 10:45:51 -0400 Received: by mail-lf1-f66.google.com with SMTP id 72so4671189lfh.6; Fri, 04 Oct 2019 07:45:49 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=f8QTZK9sCzxaP06E0HfF24SaxLLLX/pXiHs6qGwe+XA=; b=knPkFB1BlXD+Rt06m2gkaWqTL9SJSHAPwwadA/850KPlweLkfdlHUWw/f0hCHZycYt aD1VBqMPVcOneJomeJc53o96jwXMm1/sba/oBBXz4gIR+lgHScbExWA5Edcmbqq2P+j6 RJZCIy0qnkm0r1aBFF2gtw01RYr5ZnMMSKPFgFt/mV24Fal8aPJK+wXDxBSEjyNDBA+b jiqP/9vFg3xk5rk3UKareaJ4MFa6CmYQBt7tDMmEEeE0jHuX08MzLNeQGDLclJ919+lS KBYXwkCrtO8OtHHbCaYQYh6yjXq6dDXpSYh1FDa89Y+hCDtP1d1kwz8Od1VLhq5VzeI+ Moog== X-Gm-Message-State: APjAAAUsOcjMq8uzQ2aWtwdox6RMnEMHxnQecAYL0yspC/cEV3122jke dEZHMcWhOWrs+cpRCwm8ir0= X-Google-Smtp-Source: APXvYqwGCfJTSnB86hgdZ4Gku6DN0lA1FH5FrFessynFlbJyPs2FZbz/5S5l2tTYzg1E3Bxvh7XS/Q== X-Received: by 2002:a05:6512:14c:: with SMTP id m12mr9029400lfo.27.1570200349145; Fri, 04 Oct 2019 07:45:49 -0700 (PDT) Received: from xi.terra (c-51f1e055.07-184-6d6c6d4.bbcust.telenor.se. [85.224.241.81]) by smtp.gmail.com with ESMTPSA id v1sm1198536lfa.87.2019.10.04.07.45.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Oct 2019 07:45:48 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.92.2) (envelope-from ) id 1iGOqG-0005V4-5l; Fri, 04 Oct 2019 16:46:00 +0200 From: Johan Hovold To: Kalle Valo Cc: Amitkumar Karwar , Siva Rebbagondla , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Denis Efremov , Johan Hovold Subject: [PATCH 2/2] rsi: drop bogus device-id checks from probe Date: Fri, 4 Oct 2019 16:44:22 +0200 Message-Id: <20191004144422.13003-2-johan@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191004144422.13003-1-johan@kernel.org> References: <20191004144422.13003-1-johan@kernel.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org USB core will never call a USB-driver probe function with a NULL device-id pointer. Signed-off-by: Johan Hovold --- drivers/net/wireless/rsi/rsi_91x_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index 760eaffeebd6..53f41fc2cadf 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c @@ -785,10 +785,10 @@ static int rsi_probe(struct usb_interface *pfunction, rsi_dbg(ERR_ZONE, "%s: Initialized os intf ops\n", __func__); - if (id && id->idProduct == RSI_USB_PID_9113) { + if (id->idProduct == RSI_USB_PID_9113) { rsi_dbg(INIT_ZONE, "%s: 9113 module detected\n", __func__); adapter->device_model = RSI_DEV_9113; - } else if (id && id->idProduct == RSI_USB_PID_9116) { + } else if (id->idProduct == RSI_USB_PID_9116) { rsi_dbg(INIT_ZONE, "%s: 9116 module detected\n", __func__); adapter->device_model = RSI_DEV_9116; } else {