Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1779335rwb; Sun, 15 Jan 2023 04:16:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXvvSBqtYuRGeB717YpiCM5ufilOoEuYfZtIE4RnAbBLVQIcjGBPSB5YjOhxErDnXXGrioaF X-Received: by 2002:a17:902:e80a:b0:194:6f0e:990 with SMTP id u10-20020a170902e80a00b001946f0e0990mr13840132plg.39.1673784975516; Sun, 15 Jan 2023 04:16:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673784975; cv=none; d=google.com; s=arc-20160816; b=zLJHmTBTGGxQ6jr0LwMIagiDmsXdxMKkzIyA8I5CxC66cTfrIDaaBytb7C6g9pSRft Mt3vHQicJAw5Oaj9y6COHN9xpNd9v0I9sOkx08aNbXEI94Zf+lNFNR6n8ZVM97P7i6mT 1bZOkvPiTBewWFCVM+5PNdwPlrDxjlEsrW8Uu0Zn/pSLbZgMEQ0AUW0DDC765wQbI9WO qixMhMsLTyltbZZiH4CXqiIFj3eveQ5gZJebT3eHwlbOt2W2CkcSbv+rf2l4JAPxbOAZ W3e7MhzjXRu0XvHSTBetwOGm/R32U37eEhKjwSAoV1Ixahp86snhl/aR3QFD1ONpiqWg K4xw== 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=Wr+IccXUwMc0Y31SiyY1V51nZlZ4PLrLQKpSIR9xQvg=; b=04jhPlvjqUVRFFxh/42rIeTOnuULCX7CT01ftxUiJPLXJI+m2BaQi4D+Pnv1HAX8eJ saSHZInvAO2cKl4paszMctifbHaXTWZhmrQ20sTJEZgqau2RiTjviCCollwuxYkirRMW 7hEKlwser6q2FMeKfhymuuOxl16Aov8A3PS+RMXgu4rYgl1jcxZHE6llFKMHULs+jZwA H/LBRxJh6i0TQz2jn62aUrFQOfHsCG83Mx2IkcTscMlnpyx5If5Fne9IYj0yVQoHp/IP PoGlsL53NwIAsZLbOiSURc9Vk7E8+GwHVlyIY5n3Z1nxtaYKb2rLY6QzLBmIdOs/iJGU aErw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pR6tp4JB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j191-20020a638bc8000000b004b668a36b0bsi15887452pge.492.2023.01.15.04.16.03; Sun, 15 Jan 2023 04:16:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=@kernel.org header.s=k20201202 header.b=pR6tp4JB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231312AbjAOMNx (ORCPT + 63 others); Sun, 15 Jan 2023 07:13:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231133AbjAOMNv (ORCPT ); Sun, 15 Jan 2023 07:13:51 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A534FEC6A; Sun, 15 Jan 2023 04:13:50 -0800 (PST) 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 0B20760C97; Sun, 15 Jan 2023 12:13:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BF08C433D2; Sun, 15 Jan 2023 12:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673784829; bh=sTsG13W9UebwSKWU8xglNKlA4vWEJMrgT7CdeBsW/yo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pR6tp4JB1DxjfL72Mf8tLhqGd6OsxVetLkkIxeuWwUPIiD/KzF6zOmXKINHfBpDzM wr1VFsDsLEAlV32K5zAjvNSHBJYngdok+lZ/kN9hiONjUAvbbdF8mXNfbbhMJx04OV tqqSz6maeRPQjOoZEwUmjQXIhQpcehoQSix1wwWKBAsIF/295pGHV97lxOjvGuvm7q OT1pwYLInsBuZIzWNfcnByuuERosUDU6i+LwbE6RiS/3gKpWhbgbGaTMw/2GO8hMIf AomtLaGMNRdUrxITO7/AfIuhQSXikFwlPxKvOKVALwej/NnC6xAqiQbIR6Jn/Tc9OZ IqpoCykvYY9kQ== Date: Sun, 15 Jan 2023 14:13:44 +0200 From: Leon Romanovsky To: Lizhe Cc: kvalo@kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, johannes.berg@intel.com, alexander@wetzel-home.de, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] wireless/at76c50x-usb.c : Use devm_kmalloc replaces kmalloc Message-ID: References: <20230113141231.71892-1-sensor1010@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230113141231.71892-1-sensor1010@163.com> 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 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-wireless@vger.kernel.org On Fri, Jan 13, 2023 at 06:12:31AM -0800, Lizhe wrote: > use devm_kmalloc replaces kmalloc No, it is not. > > Signed-off-by: Lizhe > --- > drivers/net/wireless/atmel/at76c50x-usb.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/wireless/atmel/at76c50x-usb.c b/drivers/net/wireless/atmel/at76c50x-usb.c > index 009bca34ece3..f486ddb83d46 100644 > --- a/drivers/net/wireless/atmel/at76c50x-usb.c > +++ b/drivers/net/wireless/atmel/at76c50x-usb.c > @@ -2444,7 +2444,7 @@ static int at76_probe(struct usb_interface *interface, > > udev = usb_get_dev(interface_to_usbdev(interface)); > > - fwv = kmalloc(sizeof(*fwv), GFP_KERNEL); > + fwv = devm_kmalloc(sizeof(*fwv), GFP_KERNEL); > if (!fwv) { > ret = -ENOMEM; > goto exit; > @@ -2535,7 +2535,6 @@ static int at76_probe(struct usb_interface *interface, > at76_delete_device(priv); > > exit: > - kfree(fwv); > if (ret < 0) > usb_put_dev(udev); > return ret; > -- > 2.17.1 >