Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1886582rwb; Fri, 19 Aug 2022 11:04:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR4b3fqtxrOm0r5TZm/cWZB09b7Klnq+pMxprMv0dzkWAufBzuI/SVf/uq7FEWfiR63Bi7ki X-Received: by 2002:a17:902:7d83:b0:170:9353:f299 with SMTP id a3-20020a1709027d8300b001709353f299mr8424317plm.41.1660932266412; Fri, 19 Aug 2022 11:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660932266; cv=none; d=google.com; s=arc-20160816; b=ZNeVBUmBQIQ6AE89jh31jqbH5dkaYp7nJoKWTMSJFX0hw1trx8VQATn4Np8+EmWVvZ O9DpjRxGdssBgGZP7Jh0CpHlLVELfbse7vWcyVIU3wTnXFGDJiV7p/HCasB/3kQwpNQ1 FM3mU3tQq5z5KArvnHotJcX6aeGLxydAxRT/gj/VTOt17DsS2iR1CH+yOcmEY0LanLPB ugfunIwAUeaoNCQUWeLWLR2hUAt9ck7Svzke2ztjAdVD+YiGQglh3sr8u/Sdzk5BfKTL 9gsOKhVL/U7ljYSFy+hlSQ5p517O5lbFW4tJD2I5H5xt73ZgxTE9mEa01vrf0tC0Nlvt QSAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2zLrcpEc4pNPSw/mdu200fterEdGGKlH2cxrCvVddHQ=; b=TUCW0BV+fTdUIqk28CkyYnHv/5DSmIm1vgCjUxwIhIGXtZPSK6MThDLVNKsgdgNSwy viISXRHSOaWgkhOMaRB94frcg6JzpQzb29FzmEnHSxkaOdrpIqMH44KPI8asVjupPvBK IB2Xy58qcJwzKdCbijVXSx6txLkKx+eO0E+Cg4SwT4zXVUKkf85KgKybwvxXcLlvsAUX JCMCZ0F3mmv8+SfiusleZnpRLvGvul1BNRJiQZFZpj3MrniaUA0tNUn9qlgJk2EH4fpt lCP3Su+FUHUPk4y/5kgEBRxRPLD/E0KpGIW/aXbfRnG7TyHMQbLUlmpfRh9vO0XyFMHd 9Liw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Py4zQ9fM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j15-20020a63fc0f000000b004215af5fdb0si4789139pgi.398.2022.08.19.11.04.14; Fri, 19 Aug 2022 11:04:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Py4zQ9fM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351855AbiHSQMn (ORCPT + 99 others); Fri, 19 Aug 2022 12:12:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351981AbiHSQLM (ORCPT ); Fri, 19 Aug 2022 12:11:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F0A1112FAD; Fri, 19 Aug 2022 08:57:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CBB60616B3; Fri, 19 Aug 2022 15:57:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEC20C433D7; Fri, 19 Aug 2022 15:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924629; bh=NOfUXmPqSk1PmDgPrBf/kn0GN7etkIuaEtAbPGOg2Ns=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Py4zQ9fMRikvck3gaG62j5mGYBzDxHG7VN3qUpdusZdkfKQ/RGPIXqZGFDl3JG495 evtqJ7aE6sxHKshHVpk2ta0KctwFFqaOPqO8KyHq6pM0fAiUp2rtQ3g8p0nTohZAzo R8q+XvtmarvoE6w/4CQPNtSqCBB0ezw/CNnurUpo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Christian Lamparter , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 232/545] wifi: p54: Fix an error handling path in p54spi_probe() Date: Fri, 19 Aug 2022 17:40:02 +0200 Message-Id: <20220819153839.735951237@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 83781f0162d080fec7dcb911afd1bc2f5ad04471 ] If an error occurs after a successful call to p54spi_request_firmware(), it must be undone by a corresponding release_firmware() as already done in the error handling path of p54spi_request_firmware() and in the .remove() function. Add the missing call in the error handling path and remove it from p54spi_request_firmware() now that it is the responsibility of the caller to release the firmware Fixes: cd8d3d321285 ("p54spi: p54spi driver") Signed-off-by: Christophe JAILLET Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/297d2547ff2ee627731662abceeab9dbdaf23231.1655068321.git.christophe.jaillet@wanadoo.fr Signed-off-by: Sasha Levin --- drivers/net/wireless/intersil/p54/p54spi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intersil/p54/p54spi.c b/drivers/net/wireless/intersil/p54/p54spi.c index ab0fe8565851..cdb57819684a 100644 --- a/drivers/net/wireless/intersil/p54/p54spi.c +++ b/drivers/net/wireless/intersil/p54/p54spi.c @@ -164,7 +164,7 @@ static int p54spi_request_firmware(struct ieee80211_hw *dev) ret = p54_parse_firmware(dev, priv->firmware); if (ret) { - release_firmware(priv->firmware); + /* the firmware is released by the caller */ return ret; } @@ -659,6 +659,7 @@ static int p54spi_probe(struct spi_device *spi) return 0; err_free_common: + release_firmware(priv->firmware); free_irq(gpio_to_irq(p54spi_gpio_irq), spi); err_free_gpio_irq: gpio_free(p54spi_gpio_irq); -- 2.35.1