Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1484440pxb; Fri, 18 Feb 2022 08:43:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQW8rZXkqjJ54qtm848SysAdURC9SmO/NkL7aNgrNpbxK0mbDiOJfEvyyXXxGaCJNNeX3x X-Received: by 2002:a05:6402:3583:b0:410:a99b:59ee with SMTP id y3-20020a056402358300b00410a99b59eemr9163948edc.454.1645202597418; Fri, 18 Feb 2022 08:43:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1645202597; cv=pass; d=google.com; s=arc-20160816; b=K7wxgCVEro+K+8kxzrDD1v4Kcd5mcJ+Ew82fZAu9QQ/M5whbqgossItqLiHZRNaetR ohkhyMXRTUxB8rsB5m3uVOKSpmxRNo3gsEQwCJWdW5SOXL22+wpcO8DEGGQ9fG0y8ZPg Ay5n28fHC1A+gICdF21dPVTUNucdSg+0aXmpcLZRmw8/FmJCgxnDSEIq1UjBBzJeYhwI dA0lAMTeA4vgYsk9qsimgMuCsIygMy+COfDEXQ0O7VHVQYJnlAdLaTTa2IysTJDudp3s oxC2mzAU23zvHNe1CtF0jH2DK9nwErcO6YE2SaDjUBwj16A1T9G5t2dcpDhhpOpSnHgl x6LQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=QXWrQ1wQTyu7ba9ClnJyZOOdVNf3nys/iygpXWFV0Bk=; b=JvRJ5Q93NQ+nqRHDjpam0DX6qTkJrxISFId0hSDYIQTMae8JO6xbxBMZ7wEKIVeIpe mWdWgX/+TtdwlcM/21T89gNZ6lO6h05C7Vni6QPrm9F9evp3gESiZ2tN0iG/uSr6U1PO ywAUbznVIDVevNzOjAR+1gkgmzBRuzgwB5L+8MuqwEZSmAXl5hDYsdJfiPSwoTBNS9jw tqm8ShZs1SZmkJBaEfCnCkJ4jssklf2vYhCiPcZNIrW6MB9ntVxdBUHR/6YKfUxZSSW/ HcNHlDUWUNw7M0ANx6YdVWEfR/CmBA7UOF9xforKdlW+2OpKwuJ3yitZNwq9VCvjTG/J rdJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b="Y/gabrJH"; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz6si4558808ejc.521.2022.02.18.08.42.53; Fri, 18 Feb 2022 08:43:17 -0800 (PST) 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=@silabs.onmicrosoft.com header.s=selector2-silabs-onmicrosoft-com header.b="Y/gabrJH"; arc=pass (i=1 spf=pass spfdomain=silabs.com dkim=pass dkdomain=silabs.com dmarc=pass fromdomain=silabs.com); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235594AbiBROKR (ORCPT + 99 others); Fri, 18 Feb 2022 09:10:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233569AbiBROKP (ORCPT ); Fri, 18 Feb 2022 09:10:15 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2061.outbound.protection.outlook.com [40.107.93.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00CE51AF07C for ; Fri, 18 Feb 2022 06:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z26FYiNCIr4W2JtOV8wyhyodzb9YMbRQ5IORU8vyNXaSeKhTNIf9lJ13BF++8RBaM1xOIZRX+uN2XGwZAFDdme2sCj1o3KGdubPsTC2vWYBMC4AWquosXgZUZ3egELreEwNqhPm6a2mqnKBzCVv5c0Kxd/Qt78z79CRFW/HXYM8PpYP9y1Eje6dB0XSgNnVr96qxF0+6d10DhPkfh+9mcVW3kj6nxdIrdL8raG7nPe4OAIhnWsVFzb+bDpblTZKItYHou+17uyU72+esk2SZgjEW3w7cZPIKOjoI0iYud4zCF1Pjqu/S8RWb0S5llYAABMrBeRDwXKAzOJAu3n1qKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QXWrQ1wQTyu7ba9ClnJyZOOdVNf3nys/iygpXWFV0Bk=; b=VyJC65VVf8Oosrf2qKDTzZYSM8/LknSe9KgZ+Psl4M6gKh+9mgNFirBBrJ7g1pYhMpRIP6TNfUwZtTbL7JS6UYWr0+LlIQ8TpZL9g9DThUaVnJay0arpG18SHEI61YFA22xV4RmJe9G5cTMoO4m7OBnmIolOdekyDWCz4AK5fUvVgTkjiPWg+2rsqDGKnXVw+XDUvoqOgVmdiSaAY3C+HQyWgA90IhE/xauHy0SSCOmc6TxrLm9btqov6ATQfS5km4oj69CjpEwzZTW6OJuNo2Sk43Mqf0afXE1T5TaRBnSG/liznlVzebirEZfz88pVKHh3RRwzXO2GXqn1JNGIUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QXWrQ1wQTyu7ba9ClnJyZOOdVNf3nys/iygpXWFV0Bk=; b=Y/gabrJHFbHm99AsR/9r/RZ9NFcp0VCKKztAb2gHDgiT9brzJLam1Rcy8QSMY4y4EnbrATNKSbjjfoSI8yAtrgNJ/eenmFkJyxHlPG7lAOKtV35iu7uupm3Qx6Hdga0Ou1ivTT8CHAtNQxzyd+r65gpfMvT0sYNVETJ4vDXMGVs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silabs.com; Received: from PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) by SJ0PR11MB5939.namprd11.prod.outlook.com (2603:10b6:a03:42e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.14; Fri, 18 Feb 2022 14:09:57 +0000 Received: from PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::1b3:e483:7396:1f98]) by PH0PR11MB5657.namprd11.prod.outlook.com ([fe80::1b3:e483:7396:1f98%3]) with mapi id 15.20.4995.024; Fri, 18 Feb 2022 14:09:57 +0000 From: =?ISO-8859-1?Q?J=E9r=F4me?= Pouiller To: gregkh@linuxfoundation.org, dan.carpenter@oracle.com, xkernel.wang@foxmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Xiaoke Wang Subject: Re: [PATCH v2 1/2] staging: wfx: fix an error handling in wfx_init_common() Date: Fri, 18 Feb 2022 15:09:49 +0100 Message-ID: <1989597.O86Mz80lD7@pc-42> Organization: Silicon Labs In-Reply-To: References: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-ClientProxiedBy: PAZP264CA0155.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:1f9::19) To PH0PR11MB5657.namprd11.prod.outlook.com (2603:10b6:510:ee::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ba6e7cbb-429f-4d18-86c7-08d9f2e857de X-MS-TrafficTypeDiagnostic: SJ0PR11MB5939:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ET10Ri96R1hg9Xvw1yfLi5c9PE+g1Cap+T8y9GU7s8pSyjgBHc5ozP6kYI8Sus9kiVnk7MJ5jAKDcTr44nSux7OAT0FF2B7DOLZPQ7K05F0zLhkRwzFxNopxplVFRTkzTp91wtL+iQ7nZ8iGSXFukfaLo/qqYmQC2MevFnQC1T3sLMOuxo+FpkVbZA2NYgszS9612//Pijnk2ZHLNqnlZ+saBqD7qXCek4eWzU/xFsFUz5QXRCou3jshR+yXMaDFKyf3FOtm2vSo/R/PNrKdIngEMliNMoyrutJ93KcbvqxVNbAz2XhXFx0/0OZOlRqzBBSq0A9DqvFiMKJEz6wYcHQ524h9ft/WBy1iVUXHKflap6ZBwdsYGfXPLeZc1kgsuzW/dJTWLpaBRDW36gbcJlXeu3R9mV6hyDNKGuUov6ZC/eR2N2lYaOvlG309LJym1CBh2oiMOXPH4+9jnR2A7MMHWjDKqq4400fzDZRzDjXlhu6Ng/YanDsf12UP1wSngtu0VyttXGz4EnfesqXNSm//EK8O54QG+b8FYhqrZ++6fKD6kLFFl1sRYCkh2J/VPo1c7XSMc171di5fI1+MJgezU+/v5+PRupbtOmmTcoCQE0T1pvbJyymSdeZBmZ58N9UyEtBym4CTvbyrNVPndElh6cwaO7GnyraK5+12tkDtVA2KZOPTTHFc7CTHGpCz/nzQUcEbF8mCo3gfFV6TR4Ia3WkNY+1LSE79NlQhjXb4g0XZPHg2+wOvPLfDRhriBnCuGC2s2340PuHGR98O3g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR11MB5657.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(7916004)(366004)(66476007)(6506007)(4326008)(2906002)(33716001)(66574015)(186003)(52116002)(8936002)(5660300002)(6666004)(6512007)(8676002)(26005)(86362001)(6486002)(36916002)(83380400001)(38100700002)(66556008)(66946007)(38350700002)(508600001)(9686003)(316002)(39026012)(48020200001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?aTTIxJ8YwMaIy7gE4UlyaVXVakQ3+GgzzHhf33Uy48Ad6HoUo5QrAvoqhR?= =?iso-8859-1?Q?zinjQwqKOUGKcs4HSbcT+AEN7987I3sj0WioCDnSJZf9rxYlqkjHFFZPcR?= =?iso-8859-1?Q?tbNYhbZLP8Ct6yDB9+TZdiG03Su1Oo5V2t76VfFjt6RlIkKKiWo3cP62Ry?= =?iso-8859-1?Q?IgfIWTqbHvNd0pwgYVGT2Tw8WbzKfTp+ZE1k/z8dpewFI8aj8OiNDQFeAF?= =?iso-8859-1?Q?TFdwD+WgQoTl71O/nKRllnDL231K0DJQGBEx6r8grXa/L5c5HoqlsJ+2Ku?= =?iso-8859-1?Q?+8r8uioZLnB0hF06Fp3CUNFdmTy3JPlI2b1oN4rBXqfqh/CPlmyibrVN2T?= =?iso-8859-1?Q?vS33h9csR/FxW1EgoTsRJwdsW+/CeGsPAD/aaGn1W4bGGEjUZq2CTZo4N1?= =?iso-8859-1?Q?zNOiDrSEdu/CHaIbMPACX7x3dwKAmGgu+gLxCotZREo9enMmLgydPOjsea?= =?iso-8859-1?Q?mOam45jbGhLBtYZ8YpqKA+zkEeHK/SXB/+gEAr5mvbBhROCSeGAXVvVq1g?= =?iso-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413xODH3Om9CZJgIuvtx4nCYkrXGu?= =?iso-8859-1?Q?t+U/9tf9QkaEsKWo7unOJb3jIHz4IDSN4jUkXp9DetbXSW5tGzdgqhqHu1?= =?iso-8859-1?Q?hDnZ7B/yUBp3Zsrr+ddOObdM+oQf+oXEx5Aq8920FtduSK37hWlhcT5JIJ?= =?iso-8859-1?Q?jivky+ilIz4PSJD171rJ00iCk3yjWKeiVTjQY7e+CT5t6hS7MXR/ITZV4D?= =?iso-8859-1?Q?NAFdCtk7ivJVLgD3EGZw7jBsPeQTj8HFBxXWOJ+MfDaSV8X4Cx7H6RjtRn?= =?iso-8859-1?Q?VYsQorJG4Hg8yNJmzpU=3D?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba6e7cbb-429f-4d18-86c7-08d9f2e857de X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5657.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2022 14:09:57.1280 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kMRHDXH1vhcz72WYU0beybW18VzZnhMh9yXYcyzsyskQjqDI7eoD9AZXIx64RrEUcB8aC3qUAdtAlDR5Qcnsmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5939 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 Friday 18 February 2022 14:59:45 CET xkernel.wang@foxmail.com wrote: > From: Xiaoke Wang >=20 > One error handler of wfx_init_common() return without calling > ieee80211_free_hw(hw), which may result in memory leak. And I add > one err label to unify the error handler, which is useful for the > subsequent changes. >=20 > Suggested-by: J=E9r=F4me Pouiller > Signed-off-by: Xiaoke Wang > --- > Changelog > v1->v2 restore the wrong modification of a return statement. > drivers/staging/wfx/main.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c > index 4b9fdf9..9ff69c5 100644 > --- a/drivers/staging/wfx/main.c > +++ b/drivers/staging/wfx/main.c > @@ -309,7 +309,8 @@ struct wfx_dev *wfx_init_common(struct device *dev, > wdev->pdata.gpio_wakeup =3D devm_gpiod_get_optional(dev, "wakeup"= , > GPIOD_OUT_LOW); > if (IS_ERR(wdev->pdata.gpio_wakeup)) > - return NULL; > + goto err; > + > if (wdev->pdata.gpio_wakeup) > gpiod_set_consumer_name(wdev->pdata.gpio_wakeup, "wfx wak= eup"); >=20 > @@ -328,6 +329,10 @@ struct wfx_dev *wfx_init_common(struct device *dev, > return NULL; >=20 > return wdev; > + > +err: > + ieee80211_free_hw(hw); > + return NULL; > } >=20 > int wfx_probe(struct wfx_dev *wdev) > -- >=20 Looks right. Reviewed-by: J=E9r=F4me Pouiller --=20 J=E9r=F4me Pouiller