[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y6QJWPDXglDjUP9p@linutronix.de>
Date: Thu, 22 Dec 2022 08:38:00 +0100
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Kalle Valo <kvalo@...nel.org>
Cc: Zhengchao Shao <shaozhengchao@...wei.com>, netdev@...r.kernel.org,
linux-wireless@...r.kernel.org,
brcm80211-dev-list.pdl@...adcom.com,
SHA-cyfmac-dev-list@...ineon.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
aspriel@...il.com, franky.lin@...adcom.com,
hante.meuleman@...adcom.com, wright.feng@...ress.com,
chi-hsien.lin@...ress.com, a.fatoum@...gutronix.de,
alsi@...g-olufsen.dk, pieterpg@...adcom.com, dekim@...adcom.com,
linville@...driver.com, weiyongjun1@...wei.com,
yuehaibing@...wei.com
Subject: Re: [PATCH] wifi: brcmfmac: unmap dma buffer in
brcmf_msgbuf_alloc_pktid()
On 2022-12-21 18:33:06 [+0000], Kalle Valo wrote:
> Zhengchao Shao <shaozhengchao@...wei.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@...wei.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@...utronix.de>
Sebastian
Powered by blists - more mailing lists