Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp820688pxb; Wed, 6 Apr 2022 00:42:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKPKNAApYjaOrG9oA8e6wnE9PYqybMHJLrNNDcCkeXcCpKe4vdCzZFnD6N78gLymz77F/k X-Received: by 2002:a63:c015:0:b0:385:fe06:eb86 with SMTP id h21-20020a63c015000000b00385fe06eb86mr6021493pgg.132.1649230939259; Wed, 06 Apr 2022 00:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649230939; cv=none; d=google.com; s=arc-20160816; b=QsEE89Wg5Zr/q8YPqSTc5N8188sj47zhuU/HFvm9VLnELY3JmizfFIqP8KVJkWF8r0 F8QYJhpdoamC9nIWODrVPvAXvDPd+b4wLijKmRn47G3d0oc2fvoGCIPTk7WtMbfVlpxC p43dLjqmwdk96oO30J25Nz+t54qW48BpC5FjCFqY/Mc2bcZ7kK6PsEhvitEMq1WkbTlg +9bz1pRp9nIihsQRrJeV3toCVtLGAOdkZ4ejTMuuP01Ino8nfVZQNgE8tUCs6od8OFDv 9qrHuvVqp6UpjGiGtKzxqt0QbyOrixxkuClbVXE0S/vIhsIhfRJ1b7phHfEkINNq/fUQ V26w== 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=mtrzZ7y5LhZckmsi68GpIMccH1POhFT8v86N11GXByg=; b=kvwca6fTgip27vqEq7B0+V0U97uTr+rfG3KJx0BQs70uC2vKmZbV+8cMki4TG8X1qs 3t6u+l7aEz99HzS4DBXD4wgoLGDU8fdfUjQfX+vkxxIgj+yBRT31UuGMQnXchn25GRjS Dj3rILHpSH1D+a3dwWOnjsmMu5mAZ2DktVj0oHaG8APnWlsKWMDxiMZMUPcR0q+QFaNO zaGvFGSXs2mQ9ZbPie8XEWOM7ssFg5NuOkAEcSXd02+zdNiifbuoTZ0Isx3t9VAOEXRH luXbakadgZ+tsGWVUsbm8YTl+88ZNlMXeEbCL9P6iIEem4Bk/ZrOpg/EojCrzGyPNdz8 n7/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y5TMLqW2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j2-20020a17090276c200b00153b2d1649bsi13717677plt.163.2022.04.06.00.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 00:42:19 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Y5TMLqW2; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6C25B501B75; Wed, 6 Apr 2022 00:11:08 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376430AbiDEVZk (ORCPT + 99 others); Tue, 5 Apr 2022 17:25:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349445AbiDEJtw (ORCPT ); Tue, 5 Apr 2022 05:49:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FE6D275D9; Tue, 5 Apr 2022 02:46:07 -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 ams.source.kernel.org (Postfix) with ESMTPS id DB5B6B818F3; Tue, 5 Apr 2022 09:46:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47496C385A1; Tue, 5 Apr 2022 09:46:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151964; bh=Bv9v+Tnf3Dh6X7vGckUAUcNQxLN677ajywRcYzE3GBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y5TMLqW2dGJDofblcgG2ul74bLDA3oFgjAtU/PxpGjBlZB8+aBXXCMuaqubX7fY4g 9/kYVVZiFH1ZykQW8R7FWI0iPvToo8COFTga+jyQNBwvCKu9c+rTbaByWb6YJwgJZX nWyZZoIdM2/u2raduFKn4zXnoVSGg8M0TwHXRhLA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Straube , Sasha Levin Subject: [PATCH 5.15 578/913] staging: r8188eu: release_firmware is not called if allocation fails Date: Tue, 5 Apr 2022 09:27:20 +0200 Message-Id: <20220405070357.172299852@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: Michael Straube [ Upstream commit 39850edf2befe27bcb3d6c37b6ee76d2ee4df903 ] In function load_firmware() release_firmware() is not called if the allocation of pFirmware->szFwBuffer fails or if fw->size is greater than FW_8188E_SIZE. Move the call to release_firmware() to the exit label at the end of the function to fix this. Fixes: 8cd574e6af54 ("staging: r8188eu: introduce new hal dir for RTL8188eu driver") Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220107103620.15648-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c index a677b2049ef3..9f2b86f9b660 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c @@ -572,10 +572,10 @@ static int load_firmware(struct rt_firmware *pFirmware, struct device *device) } memcpy(pFirmware->szFwBuffer, fw->data, fw->size); pFirmware->ulFwLength = fw->size; - release_firmware(fw); dev_dbg(device, "!bUsedWoWLANFw, FmrmwareLen:%d+\n", pFirmware->ulFwLength); Exit: + release_firmware(fw); return rtStatus; } -- 2.34.1