mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Wang Hai <wanghai38@huawei.com>
Cc: <briannorris@chromium.org>, <davem@davemloft.net>,
	<kuba@kernel.org>, <shenyang39@huawei.com>, <marcelo@kvack.org>,
	<linville@tuxdriver.com>, <luisca@cozybit.com>,
	<libertas-dev@lists.infradead.org>,
	<linux-wireless@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 wireless-drivers 1/2] libertas_tf: Fix possible memory leak in probe and disconnect
Date: Wed, 27 Oct 2021 07:32:41 +0000 (UTC)	[thread overview]
Message-ID: <163531995539.30745.14828002876650574898.kvalo@codeaurora.org> (raw)
In-Reply-To: <20211020120345.2016045-2-wanghai38@huawei.com>

Wang Hai <wanghai38@huawei.com> wrote:

> I got memory leak as follows when doing fault injection test:
> 
> unreferenced object 0xffff88810a2ddc00 (size 512):
>   comm "kworker/6:1", pid 176, jiffies 4295009893 (age 757.220s)
>   hex dump (first 32 bytes):
>     00 50 05 18 81 88 ff ff 00 00 00 00 00 00 00 00  .P..............
>     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>   backtrace:
>     [<ffffffff8167939c>] slab_post_alloc_hook+0x9c/0x490
>     [<ffffffff8167f627>] kmem_cache_alloc_trace+0x1f7/0x470
>     [<ffffffffa02a1530>] if_usb_probe+0x60/0x37c [libertas_tf_usb]
>     [<ffffffffa022668a>] usb_probe_interface+0x1aa/0x3c0 [usbcore]
>     [<ffffffff82b59630>] really_probe+0x190/0x480
>     [<ffffffff82b59a19>] __driver_probe_device+0xf9/0x180
>     [<ffffffff82b59af3>] driver_probe_device+0x53/0x130
>     [<ffffffff82b5a075>] __device_attach_driver+0x105/0x130
>     [<ffffffff82b55949>] bus_for_each_drv+0x129/0x190
>     [<ffffffff82b593c9>] __device_attach+0x1c9/0x270
>     [<ffffffff82b5a250>] device_initial_probe+0x20/0x30
>     [<ffffffff82b579c2>] bus_probe_device+0x142/0x160
>     [<ffffffff82b52e49>] device_add+0x829/0x1300
>     [<ffffffffa02229b1>] usb_set_configuration+0xb01/0xcc0 [usbcore]
>     [<ffffffffa0235c4e>] usb_generic_driver_probe+0x6e/0x90 [usbcore]
>     [<ffffffffa022641f>] usb_probe_device+0x6f/0x130 [usbcore]
> 
> cardp is missing being freed in the error handling path of the probe
> and the path of the disconnect, which will cause memory leak.
> 
> This patch adds the missing kfree().
> 
> Fixes: c305a19a0d0a ("libertas_tf: usb specific functions")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wang Hai <wanghai38@huawei.com>

2 patches applied to wireless-drivers-next.git, thanks.

d549107305b4 libertas_tf: Fix possible memory leak in probe and disconnect
9692151e2fe7 libertas: Fix possible memory leak in probe and disconnect

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211020120345.2016045-2-wanghai38@huawei.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


  reply	other threads:[~2021-10-27  7:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 12:03 [PATCH v2 wireless-drivers 0/2] libertas: Fix some memory leak bugs Wang Hai
2021-10-20 12:03 ` [PATCH v2 wireless-drivers 1/2] libertas_tf: Fix possible memory leak in probe and disconnect Wang Hai
2021-10-27  7:32   ` Kalle Valo [this message]
2021-10-20 12:03 ` [PATCH v2 wireless-drivers 2/2] libertas: " Wang Hai
2021-10-20 17:33 ` [PATCH v2 wireless-drivers 0/2] libertas: Fix some memory leak bugs Brian Norris

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=163531995539.30745.14828002876650574898.kvalo@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=briannorris@chromium.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=libertas-dev@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=luisca@cozybit.com \
    --cc=marcelo@kvack.org \
    --cc=netdev@vger.kernel.org \
    --cc=shenyang39@huawei.com \
    --cc=wanghai38@huawei.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

all inboxes | Powered by JetHome®