From patchwork Sat Jan 6 10:19:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 760755 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6741A63C0 for ; Sat, 6 Jan 2024 10:19:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="aY1agAwK" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7811db57cb4so35187285a.0 for ; Sat, 06 Jan 2024 02:19:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1704536356; x=1705141156; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=JE1Bwui3iMt1py7rEEdEYZXsahJ8eFqk13DIm0Jm/Yc=; b=aY1agAwKMbGK5Alni33IGOI5CykExL0gGPDRLaTFqFDJU9U0zDeY31br6WTQJ15+iO eEerXDAlnt2mCiu0zENtgvbW77nzXlxrLgz5I3IumgEHs0/gAWPQQkN+RQRPh5PiidzX aZxolr7T8iSJs8B4+pFYpW+imV62ZF1RDPETg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704536356; x=1705141156; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JE1Bwui3iMt1py7rEEdEYZXsahJ8eFqk13DIm0Jm/Yc=; b=EG0w0o/FmDqKr7TnzATn/bwC99/pL4AN61J7NqgGsPvS8PELY8O48NsESv5QNurqPs lhi3AfOwqgziXSifP3iM5FCoh3PU88caIjif1orDXLobSYcQCaWBkO5wb85YicQsCEPm AH0kqAnctFvwwhS4e33y2njwwMLlzPzloaKoC9lxjIPp9+NvXKV4rr1YUMn+prY+pqtp ScsVCsvyVRRi2PqGPbSCJMKWtVnP/ySVuGD1Vxa3tJu/BjDc7VyISH1HJYjuQF2vxgVz nWSuaxXG5IszQEcutGkZkQg7c0K38UxL5ZgimyptvqVgE4y/cRmjUrl04gFVLu0ZLRcZ OGgA== X-Gm-Message-State: AOJu0Ywit7Z+5B84ejHI8My6wM2afRy5q8rLqbTVmRrCsEZMN8vKeS7N ZY+1UNTUR+y2Gdjb/3gS2FsQeRdLxNiG X-Google-Smtp-Source: AGHT+IGQzGvjeujJPilBBjPY0nklPprzL32Ialdiiv7RmxFpRN6au+f8f1+hPrT+6uJXNv4i3PxBBQ== X-Received: by 2002:a05:620a:e03:b0:782:71cd:252f with SMTP id y3-20020a05620a0e0300b0078271cd252fmr995173qkm.44.1704536356378; Sat, 06 Jan 2024 02:19:16 -0800 (PST) Received: from bld-bun-02.bun.broadcom.net ([192.19.148.250]) by smtp.gmail.com with ESMTPSA id ow33-20020a05620a822100b007815e176d44sm1241738qkn.64.2024.01.06.02.19.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jan 2024 02:19:15 -0800 (PST) From: Arend van Spriel To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Arend van Spriel , stable@vger.kernel.org Subject: [PATCH 2/3] wifi: brcmfmac: avoid invalid list operation when vendor attach fails Date: Sat, 6 Jan 2024 11:19:07 +0100 Message-Id: <20240106101908.266055-2-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240106101908.266055-1-arend.vanspriel@broadcom.com> References: <20240106101908.266055-1-arend.vanspriel@broadcom.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the brcmf_fwvid_attach() fails the driver instance is not added to the vendor list. Hence we should not try to delete it from that list when the brcmf_fwvid_detach() function is called in cleanup path. Cc: stable@vger.kernel.org # 6.2.x Fixes: d6a5c562214f ("wifi: brcmfmac: add support for vendor-specific firmware api") Signed-off-by: Arend van Spriel --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c index f633e2bbd891..b427782554b5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c @@ -186,9 +186,10 @@ void brcmf_fwvid_detach(struct brcmf_pub *drvr) mutex_lock(&fwvid_list_lock); - drvr->vops = NULL; - list_del(&drvr->bus_if->list); - + if (drvr->vops) { + drvr->vops = NULL; + list_del(&drvr->bus_if->list); + } mutex_unlock(&fwvid_list_lock); }