linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "wanghai (M)" <wanghai38@huawei.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: <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 net] mwifiex: Fix possible memleak in probe and disconnect
Date: Mon, 18 Oct 2021 21:13:53 +0800	[thread overview]
Message-ID: <dc70c674-c47e-9afc-afb8-918f1e22c54d@huawei.com> (raw)
In-Reply-To: <163456107685.11105.13969946027999768773.kvalo@codeaurora.org>


在 2021/10/18 20:44, Kalle Valo 写道:
> Wang Hai <wanghai38@huawei.com> wrote:
>
>> I got memory leak as follows when doing fault injection test:
>>
>> unreferenced object 0xffff888031c2f000 (size 512):
>>    comm "kworker/0:2", pid 165, jiffies 4294922253 (age 391.180s)
>>    hex dump (first 32 bytes):
>>      00 20 f7 08 80 88 ff ff 01 00 00 00 00 00 00 00  . ..............
>>      00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
>>    backtrace:
>>      [<00000000537bdb86>] kmem_cache_alloc_trace+0x16d/0x360
>>      [<0000000047666fab>] if_usb_probe+0x90/0x96e [usb8xxx]
>>      [<00000000de44b4f0>] usb_probe_interface+0x31b/0x800 [usbcore]
>>      [<000000009b1a1951>] really_probe+0x299/0xc30
>>      [<0000000055b8ffce>] __driver_probe_device+0x357/0x500
>>      [<00000000bb0c7161>] driver_probe_device+0x4e/0x140
>>      [<00000000866d1730>] __device_attach_driver+0x257/0x340
>>      [<0000000084e79b96>] bus_for_each_drv+0x166/0x1e0
>>      [<000000009bad60ea>] __device_attach+0x272/0x420
>>      [<00000000236b97c1>] bus_probe_device+0x1eb/0x2a0
>>      [<000000008d77d7cf>] device_add+0xbf0/0x1cd0
>>      [<000000004af6a3f0>] usb_set_configuration+0x10fb/0x18d0 [usbcore]
>>      [<000000002ebdfdcd>] usb_generic_driver_probe+0xa2/0xe0 [usbcore]
>>      [<00000000444f344d>] usb_probe_device+0xe4/0x2b0 [usbcore]
>>      [<000000009b1a1951>] really_probe+0x299/0xc30
>>      [<0000000055b8ffce>] __driver_probe_device+0x357/0x500
>>
>> cardp is missing being freed in the error handling path of the probe
>> and the path of the disconnect, which will cause kmemleak.
>>
>> This patch adds the missing free().
>>
>> Fixes: 876c9d3aeb98 ("[PATCH] Marvell Libertas 8388 802.11b/g USB driver")
>> Fixes: c305a19a0d0a ("libertas_tf: usb specific functions")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Wang Hai <wanghai38@huawei.com>
> mwifiex patches are applied to wireless-drivers, not to the net tree. Please be
> careful how you mark your patches.
Thanks for the reminder, I will pay attention to it in the future.

-- 
Wang Hai


  reply	other threads:[~2021-10-18 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  6:38 [PATCH net] mwifiex: Fix possible memleak in probe and disconnect Wang Hai
2021-10-18 12:44 ` Kalle Valo
2021-10-18 13:13   ` wanghai (M) [this message]
2021-10-18 17:02   ` Brian Norris
2021-10-19  3:12     ` wanghai (M)

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=dc70c674-c47e-9afc-afb8-918f1e22c54d@huawei.com \
    --to=wanghai38@huawei.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.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 \
    /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).