From mboxrd@z Thu Jan 1 00:00:00 1970 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=-0.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 F1B11C43219 for ; Fri, 26 Apr 2019 15:25:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF89B2084F for ; Fri, 26 Apr 2019 15:25:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="l9puw+7O"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="G5QzY+R5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726193AbfDZPZz (ORCPT ); Fri, 26 Apr 2019 11:25:55 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47458 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbfDZPZy (ORCPT ); Fri, 26 Apr 2019 11:25:54 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0BB0A601B4; Fri, 26 Apr 2019 15:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1556292354; bh=IXAGi2AQSXOJ3X8png4f+a2WBa5gRFzYrFfUsNxlYkk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=l9puw+7OL7G3CSkoI8bdS1LQcem66BVV88eqjuRI/JUmiiaqQ4llHDf/QHqC08iGV r/a9e12Awve7F8oMnNCx4ohMtjr3P4QLwY1NUXlBwD3+02UPb/x+z3/jj2HK/T4Gb9 W1qEGvd1SLkCvNpR75zYQsiQQlGfY8cNPI8LMjtw= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4A0B7601B4; Fri, 26 Apr 2019 15:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1556292353; bh=IXAGi2AQSXOJ3X8png4f+a2WBa5gRFzYrFfUsNxlYkk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=G5QzY+R5gJdX18wMhBzHqkBw0PkGtKO5msjlzDPVWlX5lz9cZu76izGmfEo/267pq YW8jcsMUeKvJ9RGvQWL9GPy7kipQX1wa+f4z0Ikw86PC9HuTSa91ErHyndIYu0ZM9d wnTm1aXVVdIpLF23kgq6vrEq2eXRQ2F92CFXXbiY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4A0B7601B4 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Siva Rebbagondla Cc: Julia Lawall , kbuild-all@01.org, Linux Wireless Subject: Re: [wireless-drivers-next:master 21/45] drivers/net/wireless/rsi/rsi_91x_usb.c:774:17-26: ERROR: id is NULL but dereferenced. (fwd) References: <871s1ovmo4.fsf@kamboji.qca.qualcomm.com> Date: Fri, 26 Apr 2019 18:25:50 +0300 In-Reply-To: (Siva Rebbagondla's message of "Fri, 26 Apr 2019 20:43:40 +0530") Message-ID: <87r29ou6td.fsf@kamboji.qca.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Siva Rebbagondla writes: > On Fri, Apr 26, 2019 at 8:28 PM Kalle Valo wrote: > >> Julia Lawall writes: >> >> > The ifs starting on line 766 can fail because id is NULL. > > I don't think id will be NULL here. id is coming from probe. > Is there any other opinions?. The code in question: if (id && 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) { rsi_dbg(INIT_ZONE, "%s: 9116 module detected\n", __func__); adapter->device_model = RSI_DEV_9116; } else { rsi_dbg(ERR_ZONE, "%s: Unsupported RSI device id 0x%x\n", __func__, id->idProduct); goto err1; } I think the fact that you are checking if id is NULL is confusing the static checkers. If it's never NULL why check for that anyway? So if it's guaranteed that id is never NULL (I didn't check that from USB core) I would recommend to remove the NULL checks from the driver. -- Kalle Valo