Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp556302lql; Mon, 11 Mar 2024 10:11:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWBnchLFD+mEsgrbPBnpXJ6ZBB5zyUAMWBjaAR1XeNmGpYQ2a0J3nnpQTLeBKndQpCNbRKz7iAEo0Gy7Fc2oO5uSnE5vOsTgVdht6oVQw== X-Google-Smtp-Source: AGHT+IHXZrpy9YPT3jsX9al57nMwY/5tXZqFRkPHCL8AzW0nJfbL8ruzzbLc+R72Vwn35f6g+RgN X-Received: by 2002:a17:906:fb81:b0:a43:29e1:6db8 with SMTP id lr1-20020a170906fb8100b00a4329e16db8mr4465719ejb.9.1710177111166; Mon, 11 Mar 2024 10:11:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710177111; cv=pass; d=google.com; s=arc-20160816; b=iRsOtpzGpI6vk81nS5BIfwJ4MwNT1jWWC7dJXiAz+hWVIqq2DCFh3UZd1LsQgLVS9b JKDeR6G7iFIpiKiUwA5rcC/3glczpaFdTczIN/nwW93ukcqa1U2R3oSHCH9KnY7ncqn2 C0NoGYuS4j9haizeXOHsdwKhfTzDtTbamO9DhEF88VlbmEGN0JCA8ig0hn/4EnAb5kw5 3ecI1XYPEF56hVb+nY6u/ISWeHNoTVLgNCg5e7JWDd0Oyz9Wrtr358GkM06N7Y1CfXJb zOxI1TUNfwa4NYfAuf+hk0Bv/vSxd1cHR81x+JitYKEI2KAuW+34GSzyvxws0nI/DYef Qicw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:cc:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=FKU4mrJnAoN9YC5bfeNC7qKPDdKIRepXayBmHbEmm5Y=; fh=6k22N2EITBAZGCx0Mh8FlMmBvLpcrmLmXQ6O3dOfSKU=; b=aqRJlykeEkjIm0BWhhrgvRpNqs397RvFtBFmlnw6xuKGG7FImHkktCxeM4JfAvTFtf ey+TePSv7hnjPpkw7mSaEdUKqnF7b1GaGlaKzIthpffku6nEZAkH6ZJNZLKzahwLEsUc FGCnburnkRU7wOcYHv1ZmJ1RnfR5tLT+bM2OqgToFckHYyUsnc84MKSI2hMHi/6L3O4H Bfie+2iphMIvMMeMR/sMhu0mXLP5BCC6zrYsd7EfZgXA1jmWlOQAUcKqt69tohnGI4vc +ZyD1jqN7x0Nd9dlAZ2hqwqH+KW1GcObocUFw7TIbwqW7srNg4arFxEb/Gx0YPKJMtcn 3cSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dl1NqHij; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-99293-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99293-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id lf25-20020a170907175900b00a45b96f3176si2606189ejc.853.2024.03.11.10.11.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 10:11:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99293-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dl1NqHij; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-99293-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99293-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E1DA81F21498 for ; Mon, 11 Mar 2024 17:11:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3EF24D59B; Mon, 11 Mar 2024 17:11:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="dl1NqHij" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AEB34AEC3; Mon, 11 Mar 2024 17:11:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710177088; cv=none; b=HWXnvlapoBcqz/uVWDuRCPYIEEzBMWXqaN9iopTZP01R7z48Ztz1dLQOV0F6I4CAqMbopmM1klNaEwxUhi3z7EDlK/mRfxHH8vUy+UMpk+v0HvIZYRDane6a1VtIPc+d4QEZq0wQ6p7AnBPFpRuvu5jyt3EIzoUlSfKjLmFv/P8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710177088; c=relaxed/simple; bh=5AOlmp0WhMZQanJVzfmUCGnKbq90HEOIbEhrlt/ju1k=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=CM/BGMxRkiQHrBkbfXrQKdVDo99lfRC9cyncUqyTMcH0PSxbL6KSZ+Zf61BILYXTa6c2cLArdclGZXIVgIZJMsqxcVb5BfwCsywNUHVXP7sANnrWo4c5dDt4tfcpAnU68Ozuz1sZQIJU27kGRizELv6XY+b38VPYj7KRf5w3/CA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=dl1NqHij; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1710177085; bh=5AOlmp0WhMZQanJVzfmUCGnKbq90HEOIbEhrlt/ju1k=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=dl1NqHij7NxipguTGBERLEIq1bqfVRVP4iq3wioNLnoRj8g82MYWcih38MC1YerDb YhPWoqoawOeG7J4ySudJmbQ64zMgmzEPziktv0To8I/s5RD4sK3x+XDx0nkmsIB2eC htiJP4vxClYA8IPklK1mq1etU6mBcnrMIBPNFpzDeio9bKEFjNTc5++dxjOEy9Yawi V97kUv+MyIoZND+Z8lyElxyXZeUndm0a/JY8Q3XVaIfzAcc3p95pz6amt0zErJssIV wswXPg+bMzbbuhGFVTrPNABshzD/Y01VLthmaXySK9zYeolaTh1DypNY3jBQ7OS/ku gIUIVVy+Qh8kA== Received: from [10.193.1.1] (broslavsky.collaboradmins.com [68.183.210.73]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 45F1B378200D; Mon, 11 Mar 2024 17:11:19 +0000 (UTC) Message-ID: Date: Mon, 11 Mar 2024 22:11:51 +0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: Muhammad Usama Anjum , kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] wifi: mt76: connac: check for null before dereferencing Content-Language: en-US To: Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Kalle Valo , Matthias Brugger , AngeloGioacchino Del Regno References: <20240301144406.2808307-1-usama.anjum@collabora.com> From: Muhammad Usama Anjum In-Reply-To: <20240301144406.2808307-1-usama.anjum@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Soft reminder On 3/1/24 7:44 PM, Muhammad Usama Anjum wrote: > The wcid can be NULL. It should be checked for validity before > dereferencing it to avoid crash. > > Fixes: 098428c400ff ("wifi: mt76: connac: set correct muar_idx for mt799x chipsets") > Signed-off-by: Muhammad Usama Anjum > --- > drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c > index af0c2b2aacb00..7af60eebe517a 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c > +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c > @@ -283,7 +283,7 @@ __mt76_connac_mcu_alloc_sta_req(struct mt76_dev *dev, struct mt76_vif *mvif, > }; > struct sk_buff *skb; > > - if (is_mt799x(dev) && !wcid->sta) > + if (is_mt799x(dev) && wcid && !wcid->sta) > hdr.muar_idx = 0xe; > > mt76_connac_mcu_get_wlan_idx(dev, wcid, &hdr.wlan_idx_lo, -- BR, Muhammad Usama Anjum