Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp902186pxp; Wed, 16 Mar 2022 20:42:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyHgLwt4GqBz11+4dZ78mcZoNxOYUdcuiVViPWkmwzpiMfOVecIKxlFz50Ug7Q/ir8tGPY X-Received: by 2002:a17:90a:10c8:b0:1bc:e369:1f2c with SMTP id b8-20020a17090a10c800b001bce3691f2cmr13436792pje.193.1647488553014; Wed, 16 Mar 2022 20:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647488553; cv=none; d=google.com; s=arc-20160816; b=CKmji6HNxgqQvmeBmo13T8sBzuqE4WbG+bRzvWsYVIFuuEthoVvspFSDa8Rb+jZQgN kRpZ9yCkzNHkCK2dyqdaeUhSG9I83egimxZvYwvlD7g2g6/ITJZ9FRQWCR8JEOaxzZOA X/13cPU25x7oYwIBDfyyTuhFvqD95F7++JIUyHaNuSj/WiIOx/2ezP/KejwKCugtf4pa vqMSWK+FimNZbERUfDCXUiOTWxzP/9WsSN8dhnrd7fMCmrYqm07kV0XsK6IrjupDBlZL LP13v7gBTxAHhFv+z/6fvI/pHRKnYaaDj5WjbzjevT7qUDPV2L8msorPdONhSnEOG5c+ vu4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=03ikOjiFLTHp41pT60Qg3JjmZZJXzhQSeRVEBNJlZuI=; b=w1AfAW+GbmoFwbJQXZIUQq6szdTzcPS8J0hgGmv6bXmfnbnIhXQY9E/vZe8B4uWe9U ElG9jBGWmosctdBe6XGeHQKmxrkPXDNAP3pyoRCgZUI9eD28NaTX/Q/xi1LmIkDDJ8+T QpjgUm+YPsKkxsPrzAVL0L8l1SCb598kAczCDI0q14+EdWt0iNnMtHKoMjRyR0Upov+U kD4gfcktEPC4N1+VNyieABGW10GUwiHRyYQsnS2s1UTlVtIttJUethjpAI9wlmdE6tEB fLxdr/QNjZWkA1hVSQXq0hP1Qw5ZRtrfYbd/+GvWM07Yy+Lfiwd2mm0JVF9MglmxuYwG hK2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cuDMqO1r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 13-20020a630a0d000000b003816043ef70si865840pgk.357.2022.03.16.20.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cuDMqO1r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 441EA673FA; Wed, 16 Mar 2022 20:35:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353984AbiCPG6C (ORCPT + 99 others); Wed, 16 Mar 2022 02:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239264AbiCPG6B (ORCPT ); Wed, 16 Mar 2022 02:58:01 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8A955EBD2 for ; Tue, 15 Mar 2022 23:56:47 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id h16-20020a4a6f10000000b00320507b9ccfso1639724ooc.7 for ; Tue, 15 Mar 2022 23:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=03ikOjiFLTHp41pT60Qg3JjmZZJXzhQSeRVEBNJlZuI=; b=cuDMqO1rJIvTSe/v6Cid0kPzJUA0VCDgYHQP/w2H7G0+v6lnDsgdcup/mz6Qhvy5eT v75fks/9buw4lQiUOC5k8w/9DxW9UT0By/6m6QUPY77MNYvpX0688YYTljAvo4u+gSn8 sRM7ixP7Ikh1HNDp+VHkmt9Irac3KCxtDgZ4wMnEnnAgeeh0Sk5twZd/4F2GpcQ1FJIV BNQB3a5CbHZyg1s1LaK4fEm0hZsVKXV+Z91xcuueYVJpd77tBIRAdKlJtxWQDVCgY85r Dzv10zNJvQMGlPxN4zepWgfDe4LKJALvPL4QFDYQUpsvR6VG3chrfpv5rOctRXdgDdGF lcCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=03ikOjiFLTHp41pT60Qg3JjmZZJXzhQSeRVEBNJlZuI=; b=Yw7RXW2sXkbKWB8Q2FHZ+nyh2OOEmBXTYt53iC6Yg/ahu7G6nWMuOSV92FeoZ5R9L9 aF+Pt5Bj1Rd8IPNXRHQsEmVmcivdl9AesysQi6JVzJ2NScrGKczGdqD8AEmywZEkPkOg OUuDuxeBhi4F0859KOXkmEAROvpURyzcvcGemHP6K7CX8s8JANnE342b+8HqChQ/Izge GsUaVM4k4ilBHHgweUn+bXrAtNmY+G4kgZT8LgP3OxjXGN0fAdwpHAk1/NBpudoSHXL+ Z7YLC14gnMNv7dVoLalde7bdusTGvEcTG4E1knE801q1iXhV7RSBp9vfdE01AEMVjRy5 ej3Q== X-Gm-Message-State: AOAM531GuNmLCL3W7+n4yAxVw94dAu5fKf95j8cyiJrR2d0GxkrsBUb0 G4DScz5+aKCWPl+Da/9OLEBHCGJQiPwBQFVcsh8= X-Received: by 2002:a05:6870:89a1:b0:d2:ca93:8797 with SMTP id f33-20020a05687089a100b000d2ca938797mr3099953oaq.112.1647413807028; Tue, 15 Mar 2022 23:56:47 -0700 (PDT) MIME-Version: 1.0 References: <20220309205047.45981-1-makvihas@gmail.com> <20220309205047.45981-3-makvihas@gmail.com> In-Reply-To: From: Vihas Makwana Date: Wed, 16 Mar 2022 12:26:35 +0530 Message-ID: Subject: Re: [PATCH v2 2/2] staging: r8188eu: proper error handling in rtw_init_drv_sw To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Martin Kaiser , Dan Carpenter , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 > 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. > Oh okay. I will take care of that when submitting patches in future. > I've fixed it up now. > Thanks Greg. On Tue, Mar 15, 2022 at 7:49 PM Greg Kroah-Hartman wrote: > > 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 -- Thanks, Vihas