Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4385967ioa; Wed, 27 Apr 2022 02:39:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq1mpelL7asYQJIMi/PWV+oOvrbACOidw7EhVz6/FX/Ck5nNaVz1EwTTxGtyxq4sQah8n4 X-Received: by 2002:a17:90a:b307:b0:1bd:37f3:f0fc with SMTP id d7-20020a17090ab30700b001bd37f3f0fcmr43027947pjr.132.1651052360534; Wed, 27 Apr 2022 02:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651052360; cv=none; d=google.com; s=arc-20160816; b=Gop4SNWSYbBmVDdkYBREjrjNA5tumA7dELg2qY8gxmTyxPRsUaSNijUwmcNsWYyJxM pdCwQWao9ALyVa5eF8gJPW/weENVskS2vORQHEkDMSFCgZ38X4dDOVG6g6sGBoet28rM hUJSDRgdH9IKf8m67C5xua7nOWyOVUThwy4P0qQ74FlFt5O9kkcg863uD83cZ6dH5a60 toOQCfedk2+GsBKEbz9amaymI+ON9ABVYxE2YRnY2jNpdUK90/Yuv41LBSY15qF6yP/G LOVxXC24hqiTDrnREHF2CRskqsxvz2w9eYAGo9tBhvDRhHxQI8bkUsGIVeoPYHlyRNG6 XFzQ== 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=+PZdBbkQDrrC1s6m3/DYYyOOBkkwZG5I08z6Xu1j29k=; b=l4uraZLcKVUL2lIi1mH3HbtAFpljXJ/ccIRfuDjYZjyvV1fj2MIs8ihp2DajqBNajy ecKhGC/UIIYBkam00eV3D9FXuWVkqcEs192UoEBTbevdDQgfSBeAPi/DuBgL2kXWh6ny mpMnSPNcmrLw82U7icBkwQlAoKcCi0SwAXNuZxRh2KnCR+kH0SQEbShADnu9YrmZHmUe Ug0jAPYpm+yXlD9DuCxV855SuEPiryp1Idj9fkPn0anbyKi4SjfZChRC44KvohrWyDoS jcUDfzK2xcmcCNwcB8kPbAzPwm2rRMgKlATAVzIWL4Dnovllz122vKHmBH0o+oxJ/oGO TilQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vRyA9LmX; 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 u15-20020a056a00158f00b0050d8ac9c429si282711pfk.101.2022.04.27.02.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 02:39:20 -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=vRyA9LmX; 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 CCFF51EAD1; Wed, 27 Apr 2022 02:15:33 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346105AbiDZKSA (ORCPT + 99 others); Tue, 26 Apr 2022 06:18:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348659AbiDZKRV (ORCPT ); Tue, 26 Apr 2022 06:17:21 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 206AE6D86B for ; Tue, 26 Apr 2022 02:40: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 sin.source.kernel.org (Postfix) with ESMTPS id C04B1CE1BF7 for ; Tue, 26 Apr 2022 09:40:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B48FC385AE; Tue, 26 Apr 2022 09:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650966047; bh=UN8z2B0f1uixgrTjJ4GuWq66nLJBNSlOCFUejl7xRG0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vRyA9LmX87bAOFVLGVgpQdlLBmlF1yysxasr2dXDjlU1FuDA3gKIYpSzQhJyjc1jN zAbpGKMxQfEazx0Ly+jhnTYqk0TYre0bCdoabvuodL0yFkWhS2+gPwLHgR5jwdmrx+ 6eV+LPnM1HGKYF3O1uXOrLPnuKW0+eUKSyKbiaSw= Date: Tue, 26 Apr 2022 11:40:44 +0200 From: Greg KH To: xkernel.wang@foxmail.com Cc: paskripkin@gmail.com, Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] staging: r8188eu: fix potential memory leak in _rtw_init_xmit_priv() 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=-2.5 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 autolearn=unavailable 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 Fri, Apr 08, 2022 at 09:37:10AM +0800, xkernel.wang@foxmail.com wrote: > From: Xiaoke Wang > > In _rtw_init_xmit_priv(), there are several error paths for allocation > failures just jump to the `exit` section. However, there is no action > will be performed, so the allocated resources are not properly released, > which leads to various memory leaks. > > To properly release them, this patch unifies the error handling code and > several error handling paths are added. > According to the allocation sequence, if the validation fails, it will > jump to its corresponding error tag to release the resources. > > Signed-off-by: Xiaoke Wang > --- > ChangeLog: > v1->v2 update the description and adjust the sequence of patches. > v2->v3 None to this patch, but some to another pathch in this series. > drivers/staging/r8188eu/core/rtw_xmit.c | 32 ++++++++++++++++++------- > 1 file changed, 24 insertions(+), 8 deletions(-) I still have 12 patches in my queue from you, yet no idea which order they belong in at all, nor which is the latest versions :( Please rebase and resubmit them ALL as a single patch series so I can have a hint as to what to do here. thanks, greg k-h