From patchwork Sat Jan 6 10:38:34 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: 760752 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 346866FC7 for ; Sat, 6 Jan 2024 10:38:45 +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="DeB7TLgv" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-3bbd1e9c5f7so353611b6e.3 for ; Sat, 06 Jan 2024 02:38:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1704537525; x=1705142325; 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=y4l4rlQEsvsZZQ6U5IvsLtPxydTJ0b9STdaRFVRg44U=; b=DeB7TLgvzL1ua28g86qGDrXHSEwRApWvsJqXSGTuMc9aRyR2Qg5rNAUEjuten/f7Pr kXIilz/Y1p6NvqoHlXH9zEC0sAOLE0JK7KNXnS+/vQccjlT6ns0gmp0bAVmc7pTT2c5J KOyQ849N9yjdsX2zALaGgSSvk/MChbpgTPpBA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704537525; x=1705142325; 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=y4l4rlQEsvsZZQ6U5IvsLtPxydTJ0b9STdaRFVRg44U=; b=bmv1sL+xAt0E6G8D7smh5n1zn7bMeWo+oYXEdYNxWKQiNUvUZ2/TsBpZ24CEK3Mktt Mu1emmUnM4r5jnEibXLbToxuXaIMFTlaZLE+qvzswMm0MVuiK3uQVugWX5aYQ5bOYoOl +awq9wL1ZgoHNEs7bfi3MkKuyWgK2g7sK2bT6bozVj3fMuuEPKwjKZZzs2gddP7uClnL D7PHUk1Xf1XB74Efpd7K9G6WGbjxR+/lN/lA1+cnc1oi0lOrT0S5d+oNLCpfDSrRQLmJ 7JizhO5C0BWKgQU6V+QnjQUpedPMnUappi8on6TOB/HIBHqbwuAryqlj0MEiiiR6xBkq FW8Q== X-Gm-Message-State: AOJu0YyW/qfbvgzfZb0MyeZP4QMm954HXfA4J5lfRapjwzYKuKPvFfgw NJafAh8dvNxNBxkuOiHobn55sHUu5+C2 X-Google-Smtp-Source: AGHT+IF+jE7Prvz+WmUrBKmSaqaewdFpw+ykdLMYFrOWgb5H9Z+V+y2CTbEme+UJR8u4JfCGgfECLw== X-Received: by 2002:a05:6808:14c8:b0:3bd:20b5:1b20 with SMTP id f8-20020a05680814c800b003bd20b51b20mr319881oiw.69.1704537525202; Sat, 06 Jan 2024 02:38:45 -0800 (PST) Received: from bld-bun-02.bun.broadcom.net ([192.19.148.250]) by smtp.gmail.com with ESMTPSA id k1-20020ad44501000000b0067f70fffc7bsm1312927qvu.2.2024.01.06.02.38.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Jan 2024 02:38:43 -0800 (PST) From: Arend van Spriel To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Arend van Spriel , stable@vger.kernel.org Subject: [PATCH V2 2/3] wifi: brcmfmac: avoid invalid list operation when vendor attach fails Date: Sat, 6 Jan 2024 11:38:34 +0100 Message-Id: <20240106103835.269149-3-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20240106103835.269149-1-arend.vanspriel@broadcom.com> References: <20240106103835.269149-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); }