Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp953501pxp; Wed, 16 Mar 2022 22:29:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiEY7jEchqLtEb3kfTh58yEEOKVe6BSnd9AzL9yjp00D2tQeZAxg7inPxF4LHBglIlTfmS X-Received: by 2002:a17:902:e848:b0:151:e3a5:b609 with SMTP id t8-20020a170902e84800b00151e3a5b609mr2979029plg.137.1647494981611; Wed, 16 Mar 2022 22:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647494981; cv=none; d=google.com; s=arc-20160816; b=bl1pcxcfkeDpNvsvwVsAT0FTl5U9J9MgCUwzIfLf08c8X1N4Zy8x2l5A5iY1JRNg7W 0gPlVE08x5BXuK+LVZaXz61oWm7HxppGLxJ5La1AflWIuyxEXMAcQVCsivtXFfSt0HCe g2DwB0Z/2wU+xgZywby3wXh9GrwEWdAbHNh4t72BHuq0NZzM/1zyKq2ZHNgUgaw4goTq lwIEqvTcSdT4hSlbjFCnlcSZYU0C8uIBLYRQ0+e48LsKcGa1FrbEPquFmH8CETrcSwdm D7DKrie+IyTGBDQiFGGMOv1lIy+6PToT0/r4xLqiKcgZSl6snd9vfNDD8Z91TNWYiH9y asWQ== 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=7W3+ELqu8ox958dn5E/Fki03XawvQs/nAu590tpVCMg=; b=EAmxnUBgBEN1WTc8ZNtfdB0/XHKYj2fmk6WCYkKGCsFc1etGyUk9nm4xDE/t0hws8z Zdb10QU1dNzi5xARKnPhwWd5WX5HpWrCPVXDmXsLHmWkZzslMQuhsZ7rW1zP1o4CuKrQ MN0rAknmhNLFOtShaoz50JGlV6HlOAsrfskDi4dG86IeGg6466Co3Y8ls6lH9QRNyBBt e/Pev7AvpctB/Z0GF1ztyn/j3WKIzThKw/f2aiQ6T3VShpVHcTVvUvMOP5nZxRAm7pLk NaZ5B6Hjr03WZtm2xMtwCcQv7odwwQbhp/2BNIkEucUSS0rHjYnTjkStWzSZWtOQCX2T xStA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AF8hNNxy; 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 fv21-20020a17090b0e9500b001bd14e01f26si4317289pjb.20.2022.03.16.22.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 22:29:41 -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=AF8hNNxy; 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 40DF810243F; Wed, 16 Mar 2022 21:31:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349123AbiCOOUb (ORCPT + 99 others); Tue, 15 Mar 2022 10:20:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349088AbiCOOU2 (ORCPT ); Tue, 15 Mar 2022 10:20:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B05A7506FC for ; Tue, 15 Mar 2022 07:19:16 -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 4A70B616BA for ; Tue, 15 Mar 2022 14:19:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80D40C340EE; Tue, 15 Mar 2022 14:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647353955; bh=XG3mqAvP/dgv8ZgDBZ/3Z9nNgKycZZez7LoUFfJqTpM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AF8hNNxypPS+AW1Eada7SmDukRd+tldbByT4OYCtDObqIMBInADoSmsC+qDXq/rWL O6If94P6zqzTcIoqmlzAj7kC9y8uj+2dmBFaz85/bWwJg64VVcs+7eiEJZbyw8giCz gML2D+C5D2VqARmcEzNh1tsvo2Zf1oGxfyeMrToo= Date: Tue, 15 Mar 2022 15:19:09 +0100 From: Greg Kroah-Hartman To: Vihas Makwana Cc: Larry Finger , Phillip Potter , Michael Straube , Martin Kaiser , Dan Carpenter , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] staging: r8188eu: proper error handling in rtw_init_drv_sw Message-ID: References: <20220309205047.45981-1-makvihas@gmail.com> <20220309205047.45981-3-makvihas@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220309205047.45981-3-makvihas@gmail.com> X-Spam-Status: No, score=-3.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,T_SCC_BODY_TEXT_LINE 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 Thu, Mar 10, 2022 at 02:20:47AM +0530, Vihas Makwana wrote: > The code inside rtw_init_drv_sw() calls various init functions to > populate the padapter structure and checks for their return values > respectively. > But if one of the functions in middle fails then it simply returns > _FAIL instead of proper logging and calling freeing counterparts > of previous init functions. > This leads to various memory leaks and can be found in > /sys/kernel/debug/kmemleak if kernel is compiled with DEBUG_KMEMLEAK=y. > > Fix this and keep the success and error separate. > > Fixes: 2b42bd58b321 ("staging: r8188eu: introduce new os_dep dir for > RTL8188eu driver") Nit, that needed to be on one line, and no blank line before the next ones. I've fixed it up now. thanks, greg k-h