Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1621653rwn; Fri, 9 Sep 2022 01:03:24 -0700 (PDT) X-Google-Smtp-Source: AA6agR64sjWwsXyXOsRMfqKQCUH67UJBoe+wP3xszh31wumdunq7pXqyy1qUC7R4/340o06/R1R2 X-Received: by 2002:a05:6512:1156:b0:498:ef07:d6e with SMTP id m22-20020a056512115600b00498ef070d6emr2279675lfg.236.1662710603662; Fri, 09 Sep 2022 01:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662710603; cv=none; d=google.com; s=arc-20160816; b=Fz0176naq33oSCC/w1ePQLg7G3G36s7wf6BNyZ22z3RFT2dMruMsKk5wOBbZDEc4D/ Dfp1fc2ndbe7+r+cLMIHfY2Rfbet3/LteuyeHCyePPQkg8rV+EkTwVwvvemJcoxcY4Uv znk8J7GRIosGQO7ql1h+OztD7vSRPTKP4q5AwyoKsuA+YyMQNSjGQVKdCIQkJ6vL3IVY AZ5CfCxSWUNtUQgzzByDyxPBM3yLD1X6u0jBFekiECFXGFU/unhcKLRnAEyGK+QVDty3 w9duO9gTlhUKtgkfgADOl6sP4kYxKK/W5nDzFPUY545pd3OfyWJhTQaKVeTqsTQlQZO4 NZuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q/NYYxwBMArrVcY7FA/KTNyxp5ZIzdx98EKLiaOrjeA=; b=xuqZhHt9kW8gsxGs78jxtcRCdNM2/PboTmQmWeolwFXGqCNBUX2YiHAX5nYyGHAT44 xMwbydR6xmH3/6eCooKUwcfRPcIyvvg4qDGB2E1ZHpcZGnN7UWs202W8x1voejatqgHG w1pDD/Iy+0F1p+WiVe1xKwapC1aqVyFVTM21JXsowDIw4iXBa5TrzejL+8+c7M54X/N1 x5hPAdb+lE89K2AtHoh8hx3X6nAkUy6a3taW+W2tQcXZiLRJh96nlMVw4Rp8R2fVdsDt p9dgLU/Jphu1DHjbvR2CiJFKCHlreOYU3DGstlQxgL/wk3jUMu1Aafe2dBoNw7I6+OuW wK/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2LQaXzxB; 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 k11-20020a05651c0a0b00b0025ecc5864f2si574144ljq.633.2022.09.09.01.02.54; Fri, 09 Sep 2022 01:03:23 -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=2LQaXzxB; 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 S230236AbiIIHwU (ORCPT + 99 others); Fri, 9 Sep 2022 03:52:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbiIIHv6 (ORCPT ); Fri, 9 Sep 2022 03:51:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BF0A80027 for ; Fri, 9 Sep 2022 00:48:13 -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 35E0061E8E for ; Fri, 9 Sep 2022 07:48:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C786C433C1; Fri, 9 Sep 2022 07:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662709692; bh=cembJTLzrsCcUN/TdAvvEAHow2IUj6Pixg3rsqu8vrE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=2LQaXzxBgKa0nuijX34MpyVVJeGBKhC7JtE6S9ENOUo7Rks/AoLMRwK7bUby2Q5nT phHrAe6sbGDnVoqVc21iaxfLveldSx/DrwXlzv9ICEbct5xJdSnvjxPeJcMFaWOPa3 8mnH1wkJSK5pFVBJwjYljom+iO3GKU+ph0bfMRUE= Date: Fri, 9 Sep 2022 09:48:10 +0200 From: Greg KH To: xkernel.wang@foxmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] staging: rtl8723bs: fix potential memory leak in rtw_init_drv_sw() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Thu, Sep 08, 2022 at 03:31:25PM +0800, xkernel.wang@foxmail.com wrote: > From: Xiaoke Wang > > In rtw_init_drv_sw(), there are various init functions are called to > populate the padapter structure and some checks for their return value. > However, except for the first one error path, the other five error paths > do not properly release the previous allocated resources, which leads to You have trailing whitespace on your text :( > various memory leaks. > > This patch fixes them and keeps the success and error separate. As there > is no FooBar device to test with, no runtime testing was performed. What do you mean by "FooBar"? Please fix that up. thanks, greg k-h