Message ID | 7658242ceef838cc553cb3bbb63ede20d1bf9cb5.camel@perches.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-70035-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp480240dyc; Sat, 17 Feb 2024 11:40:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWCKNHzjuIFe4ipEfiYGieM3aVJzAVlc5VDzBIIeFZL0vbatsV5hYR0t/6FXztDWL2VxdBV+GK/yQdjSYZrorTqGflU0Q== X-Google-Smtp-Source: AGHT+IHJzMoZjpGVCY6G0M9A5xw0hMx/Xp4PowgJOU7dwzCjBSlxDThhZkEdXopjvcGr8ckkF+0j X-Received: by 2002:a05:6871:2b25:b0:210:e14a:7a9c with SMTP id dr37-20020a0568712b2500b00210e14a7a9cmr7753890oac.58.1708198835169; Sat, 17 Feb 2024 11:40:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708198835; cv=pass; d=google.com; s=arc-20160816; b=qBHCWnUSH3Hk202RJfbI8e8fmf2HGceEqgAWPg3bmCi7mhRSjEdNcENzmJtK+Uzpwk Quc6NbSvFuH5Qn++Ff4Q/kXmnKae4iq63ztnL3d7mcmFNelPPnFT1P+mTjJoIgL0TyzY IdsY9XtsbP3WLQ7M/zGxDWqfT2nbKJegppKhWpMJJHfYesZr0E2IjzVPlTW+TJ7wkpBA PBuo03HcmXA3nY4I56F+YGbkU4dLNzXM4zmObNz79/i+9mnWQy0QuyIR0XfeRN4GIwQi 4MVEEPMs3hpuZcCAKqP67kIK14c02qAKO1Au5Hvds3Wa8itvXoLhBo2v9Vk1I4jv2pbB apHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:date:cc:to:from:subject :message-id; bh=pF8OvjyeNde4P55Hv0cJWjukSV1s/ZAqwG4saqwAiQg=; fh=zlZbVNcWB4qT+P9OPwxNPZrN5/HiWxpccLOT0iWVHb4=; b=xoSMbE2ntIj7JgsG7nbSQUTm9ghMGRLIdsvKOfxtyYBm3/D9c6x2AdWAtJ+Y0EdHwx 0nTLiPIFohIXXqfIUy9r56AKjMQ//X67wWjeuggFAggSM6E5NepY5VQQTACroH4ZFbac GMpe96vL/CYiK+5uooXkMh/+ZgEXGxkBYkafVZmMTBDCH1Uehl2StMBdS2BgclnZWgXS bTd6Bf0g9viX4dc5Uya7W1S9JFeeIaZo52DYlOqT9sgznI8ptKXlRvC79fPlmqGp3IfD FQ/Bc1wvdA3wuGvdKHyR7AeUB5eixoxG1Mxngt+mdwleK0lBJvIRQRb2BUsAV95aJoei qyJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-70035-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70035-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s8-20020a17090a948800b00298cc2f1af3si1907005pjo.28.2024.02.17.11.40.35 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 11:40:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70035-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=perches.com); spf=pass (google.com: domain of linux-kernel+bounces-70035-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70035-ouuuleilei=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id EE44A282C1F for <ouuuleilei@gmail.com>; Sat, 17 Feb 2024 19:40:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D052E7E59C; Sat, 17 Feb 2024 19:40:19 +0000 (UTC) Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) (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 D22CD7E577; Sat, 17 Feb 2024 19:40:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708198818; cv=none; b=s/KUxOp1J7wsyWRXvc3NhW3kVEvBTLzm90Is+LsovVZhOCv6f0xyBW3tMsrPIiNc8zmHI6pPMF+sH7MLGi+oE6/V2X6xuYc71r7NVnRtyZ5tfXMiJIJ0nO8jshh0buAqBJ//50B+7p+/nk0ODPs2/mJfWY6ychI3rZjsIl5Dhv4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708198818; c=relaxed/simple; bh=J2ytfZaYSAZQyO8x+e3VhJmlyC3h1laCCKwfpuUERQc=; h=Message-ID:Subject:From:To:Cc:Date:Content-Type:MIME-Version; b=gh1D/w/jpx6GgKtKnA5RmSJfo5m4zWLXr33U0tLxcAgVhZ3wfWczfOHIXk79p3F51XV1Xg8HZl510eGcDtWufxua7EWCcuFC/5G+6X21aTIIept/7xFDCrHkHdtQKqaeHWi2z5N6to1E2c6NB2csLcNw78ZQuhcDlDGPV17cEYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com; spf=pass smtp.mailfrom=perches.com; arc=none smtp.client-ip=216.40.44.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perches.com Received: from omf17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id BB95980326; Sat, 17 Feb 2024 19:40:09 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf17.hostedemail.com (Postfix) with ESMTPA id 6F6B01A; Sat, 17 Feb 2024 19:40:07 +0000 (UTC) Message-ID: <7658242ceef838cc553cb3bbb63ede20d1bf9cb5.camel@perches.com> Subject: broadcom: brcmfmac, alloc without null test From: Joe Perches <joe@perches.com> To: Arend van Spriel <arend.vanspriel@broadcom.com> Cc: Kalle Valo <kvalo@kernel.org>, linux-wireless@vger.kernel.org, brcm80211@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, LKML <linux-kernel@vger.kernel.org> Date: Sat, 17 Feb 2024 11:40:06 -0800 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-Stat-Signature: otkpsbwgsgz9cbsycrxaiy1huqbpt47z X-Rspamd-Server: rspamout07 X-Rspamd-Queue-Id: 6F6B01A X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/0TOWJG50euXH/Y2/XmM/8hmtHbmXurDY= X-HE-Tag: 1708198807-741751 X-HE-Meta: U2FsdGVkX1/XB7jer+wcyMGzLnQLgoWpYpVv5i9TuUVNqk4/ULH990HmWOgvHIw0rMyC68L0cVRGmiRbaYixVYJXY7ffNEfIrC8nX5bIcULM5qFE60Fbo+tDGD5VqkoZpOqNnrfSloZ3EP77X4xngZzOLasDZBSijvOphot0ffQuWSOWc2pautGfNknY6ncNejCdUb0hngLYygflM1AmPWGA12fpcSsYIkvk+CJ+kuP6s25rV0GZzrGZuZR+XE2FY6mooee56bWaD5LcoL3/WaO8X6IOscS/YPGOpSZoDSfMmVrw4u5OelvZlD2FLHsx X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791176301615995300 X-GMAIL-MSGID: 1791176301615995300 |
Series |
broadcom: brcmfmac, alloc without null test
|
|
Commit Message
Joe Perches
Feb. 17, 2024, 7:40 p.m. UTC
There's a missing NULL alloc test here: It doesn't appear obvious what a proper fix is.
Comments
On 2/17/2024 8:40 PM, Joe Perches wrote: > There's a missing NULL alloc test here: > > It doesn't appear obvious what a proper fix is. > > diff -u -p ./drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c /tmp/nothing/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c > --- ./drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c > +++ /tmp/nothing/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c > @@ -4308,7 +4308,6 @@ brcmf_pmksa_v3_op(struct brcmf_if *ifp, > int ret; > > pmk_op = kzalloc(sizeof(*pmk_op), GFP_KERNEL); Thanks, Joe Looking at the callers I would say returning -ENOMEM here when pmk_op is NULL should do the trick. Regards, Arend > - pmk_op->version = cpu_to_le16(BRCMF_PMKSA_VER_3); > > if (!pmksa) { > /* Flush operation, operate on entire list */ >
diff -u -p ./drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c /tmp/nothing/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c --- ./drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ /tmp/nothing/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -4308,7 +4308,6 @@ brcmf_pmksa_v3_op(struct brcmf_if *ifp, int ret; pmk_op = kzalloc(sizeof(*pmk_op), GFP_KERNEL); - pmk_op->version = cpu_to_le16(BRCMF_PMKSA_VER_3); if (!pmksa) { /* Flush operation, operate on entire list */