netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Zhengchao Shao <shaozhengchao@huawei.com>,
	netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
	brcm80211-dev-list.pdl@broadcom.com,
	SHA-cyfmac-dev-list@infineon.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	aspriel@gmail.com, franky.lin@broadcom.com,
	hante.meuleman@broadcom.com, wright.feng@cypress.com,
	chi-hsien.lin@cypress.com, a.fatoum@pengutronix.de,
	alsi@bang-olufsen.dk, pieterpg@broadcom.com, dekim@broadcom.com,
	linville@tuxdriver.com, weiyongjun1@huawei.com,
	yuehaibing@huawei.com
Subject: Re: [PATCH] wifi: brcmfmac: unmap dma buffer in brcmf_msgbuf_alloc_pktid()
Date: Thu, 22 Dec 2022 10:46:22 +0200	[thread overview]
Message-ID: <87cz8bkeqp.fsf@kernel.org> (raw)
In-Reply-To: <Y6QJWPDXglDjUP9p@linutronix.de> (Sebastian Andrzej Siewior's message of "Thu, 22 Dec 2022 08:38:00 +0100")

Sebastian Andrzej Siewior <bigeasy@linutronix.de> writes:

> On 2022-12-21 18:33:06 [+0000], Kalle Valo wrote:
>> Zhengchao Shao <shaozhengchao@huawei.com> wrote:
>> 
>> > After the DMA buffer is mapped to a physical address, address is stored
>> > in pktids in brcmf_msgbuf_alloc_pktid(). Then, pktids is parsed in
>> > brcmf_msgbuf_get_pktid()/brcmf_msgbuf_release_array() to obtain physaddr
>> > and later unmap the DMA buffer. But when count is always equal to
>> > pktids->array_size, physaddr isn't stored in pktids and the DMA buffer
>> > will not be unmapped anyway.
>> > 
>> > Fixes: 9a1bb60250d2 ("brcmfmac: Adding msgbuf protocol.")
>> > Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
>> 
>> Can someone review this?
>
> After looking at the code, that skb is mapped but not inserted into the
> ringbuffer in this condition. The function returns with an error and the
> caller will free that skb (or add to a list for later). Either way the
> skb remains mapped which is wrong. The unmap here is the right thing to
> do.
>
> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Thanks for the review, very much appreciated.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

  reply	other threads:[~2022-12-22  8:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07  1:31 [PATCH] wifi: brcmfmac: unmap dma buffer in brcmf_msgbuf_alloc_pktid() Zhengchao Shao
2022-12-21 18:33 ` Kalle Valo
2022-12-22  7:38   ` Sebastian Andrzej Siewior
2022-12-22  8:46     ` Kalle Valo [this message]
2022-12-22  8:52       ` shaozhengchao
2022-12-22 10:59         ` Arend van Spriel
2022-12-22 11:35           ` shaozhengchao
2022-12-22 11:37             ` Arend van Spriel
2022-12-22 16:10 ` Kalle Valo

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=87cz8bkeqp.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=SHA-cyfmac-dev-list@infineon.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=alsi@bang-olufsen.dk \
    --cc=aspriel@gmail.com \
    --cc=bigeasy@linutronix.de \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=chi-hsien.lin@cypress.com \
    --cc=davem@davemloft.net \
    --cc=dekim@broadcom.com \
    --cc=edumazet@google.com \
    --cc=franky.lin@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pieterpg@broadcom.com \
    --cc=shaozhengchao@huawei.com \
    --cc=weiyongjun1@huawei.com \
    --cc=wright.feng@cypress.com \
    --cc=yuehaibing@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).