Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3007571rwb; Mon, 15 Aug 2022 16:02:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Yz7FhQWRC/QuWuHTS7ua9tPu86XbMGaAejzjW/vni8TbbhlNEE8RK0FPZldS44MVuR3aE X-Received: by 2002:a17:907:1b03:b0:6ff:78d4:c140 with SMTP id mp3-20020a1709071b0300b006ff78d4c140mr11749428ejc.554.1660604569776; Mon, 15 Aug 2022 16:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660604569; cv=none; d=google.com; s=arc-20160816; b=q7KjDxHQtn3mXLvUgLkncuIu+ew0NijwLwv4uQh5t/QmJJD+9ZsXKGl1LbOfnq//tO +ZTpuI8TUd5yXywSNxH85y8vMHcuTL7L5SvS6mERL9+JhCEyK6WJZEGEJzms/HAhtusN fdZVh09W4Xk2E8Fs3kGWPzUMc+sfvuymo+LqDhNB2LI1+yLY8VxtW/TvWUx+dGwaLdEs 9Kpux4vnaS9VfWjv0mJ0Mr5j1gzTqf5Ye3uk61gNChuMYoDmThjQ7iOtFuQ3EYI4nAyM dTfg7m46dQnYfopHOtPTL8JXlmBrzcQuSlXdm5YfaEY6Ty0EWa+Y1plpayVzILt5FZBB ZVrg== 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=agf1+0Rg/1B1TYlHIyKxEQZJWVuebhsWvhdBHKjNXVE=; b=sHLKIF/+4y//Qlo3ygffMp+29oxE+1VNrW9XcUm4l9oJSZv/3Z9ajA69QbmG+Y0X7T GGHWJrDrnR8A4gXzL8NhEN84IxToXHtVpBlUzcOZAXaDtDWGyyxBZ3/5+ZZy/QzNaE+r P1QXs97WkI/o27L2fqC3jbMNIUXD6lAgrhme5n+ere+8Am48NHEMw/WLTv/b5f3qRrq2 ULOHBQ2LHRBTwKJvexLSU6d4tm+rWL5KP671LkBhr6HvMj5lqU8E7l3o7wRf/yOJ3lbZ 8YCghoJV1FMdWf1sg+c0t3g3bmeEccMpxm2bhioWkBx6nxJ/m0ueQuzR4hhtMqTEtnaq QQRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="rsh5hG/W"; 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 qf25-20020a1709077f1900b0073317fc9d6fsi10419924ejc.917.2022.08.15.16.02.23; Mon, 15 Aug 2022 16:02:49 -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="rsh5hG/W"; 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 S1343702AbiHOVVD (ORCPT + 99 others); Mon, 15 Aug 2022 17:21:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241870AbiHOVNw (ORCPT ); Mon, 15 Aug 2022 17:13:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A69E5723A; Mon, 15 Aug 2022 12:19:51 -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 6DB686009B; Mon, 15 Aug 2022 19:19:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70380C433D6; Mon, 15 Aug 2022 19:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591189; bh=0UKjixtL0eNbQD7Gi+0rqyBPU1iqbuobQHBHws/8h70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rsh5hG/Wc5bYF/vXt48K7Ix8RYmQ8vD/gbfa3YRXkR8cvms5rBYnBVMXQgoWzYI8D /+nNbiX7YElthvfUmglURxhGM19M9HbgTlLGZbXogCAgU1fbDTYeIXXhk8NcFMMrLE cTWwkIPIx5Vwc9DMmJ+sjrs1PGBUqUSexzXrBdcY= 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.18 0468/1095] wifi: p54: Fix an error handling path in p54spi_probe() Date: Mon, 15 Aug 2022 19:57:47 +0200 Message-Id: <20220815180448.961526283@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 f99b7ba69fc3..19152fd449ba 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