All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Zheyu Ma <zheyuma97@gmail.com>
Cc: Jes.Sorensen@gmail.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Zheyu Ma <zheyuma97@gmail.com>
Subject: Re: wifi: rtl8xxxu: Fix the error handling of the probe function
Date: Wed, 27 Jul 2022 12:53:02 +0000 (UTC)	[thread overview]
Message-ID: <165892638117.11639.15108682372355290807.kvalo@kernel.org> (raw)
In-Reply-To: <20220716130444.2950690-1-zheyuma97@gmail.com>

Zheyu Ma <zheyuma97@gmail.com> wrote:

> When the driver fails at ieee80211_alloc_hw() at the probe time, the
> driver will free the 'hw' which is not allocated, causing a bug.
> 
> The following log can reveal it:
> 
> [   15.981294] BUG: KASAN: user-memory-access in mutex_is_locked+0xe/0x40
> [   15.981558] Read of size 8 at addr 0000000000001ab0 by task modprobe/373
> [   15.982583] Call Trace:
> [   15.984282]  ieee80211_free_hw+0x22/0x390
> [   15.984446]  rtl8xxxu_probe+0x3a1/0xab30 [rtl8xxxu]
> 
> Fix the bug by changing the order of the error handling.
> 
> Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>

Patch applied to wireless-next.git, thanks.

13876f2a087a wifi: rtl8xxxu: Fix the error handling of the probe function

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20220716130444.2950690-1-zheyuma97@gmail.com/

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


      reply	other threads:[~2022-07-27 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-16 13:04 [PATCH] rtl8xxxu: Fix the error handling of the probe function Zheyu Ma
2022-07-27 12:53 ` Kalle Valo [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=165892638117.11639.15108682372355290807.kvalo@kernel.org \
    --to=kvalo@kernel.org \
    --cc=Jes.Sorensen@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=zheyuma97@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.