From: Leon Romanovsky <leon@kernel.org>
To: Lizhe <sensor1010@163.com>
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
Date: Sun, 15 Jan 2023 14:13:44 +0200 [thread overview]
Message-ID: <Y8Pt+IdfWBVy8nIA@unreal> (raw)
In-Reply-To: <20230113141231.71892-1-sensor1010@163.com>
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 <sensor1010@163.com>
> ---
> 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
>
prev parent reply other threads:[~2023-01-15 12:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-13 14:12 [PATCH v1] wireless/at76c50x-usb.c : Use devm_kmalloc replaces kmalloc Lizhe
2023-01-13 17:22 ` kernel test robot
2023-01-14 9:43 ` kernel test robot
2023-01-15 12:13 ` Leon Romanovsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y8Pt+IdfWBVy8nIA@unreal \
--to=leon@kernel.org \
--cc=alexander@wetzel-home.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johannes.berg@intel.com \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sensor1010@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).