[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABikg9zWrchOQdaQ-MTQe6kw6ocRxEgkeAvL4zhUOkwiNfSDtA@mail.gmail.com>
Date: Fri, 19 Aug 2022 10:27:35 +0300
From: Sergei Antonov <saproj@...il.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
Vladimir Oltean <olteanv@...il.com>
Subject: Re: [PATCH 1/2] net: moxa: do not call dma_unmap_single() with null
On Thu, 18 Aug 2022 at 22:18, Andrew Lunn <andrew@...n.ch> wrote:
>
> On Thu, Aug 18, 2022 at 09:29:47PM +0300, Sergei Antonov wrote:
> > It fixes a warning during error unwinding:
> >
> > WARNING: CPU: 0 PID: 1 at kernel/dma/debug.c:963 check_unmap+0x704/0x980
> > DMA-API: moxart-ethernet 92000000.mac: device driver tries to free DMA memory it has not allocated [device address=0x0000000000000000] [size=1600 bytes]
> > CPU: 0 PID: 1 Comm: swapper Not tainted 5.19.0+ #60
> > Hardware name: Generic DT based system
> > unwind_backtrace from show_stack+0x10/0x14
> > show_stack from dump_stack_lvl+0x34/0x44
> > dump_stack_lvl from __warn+0xbc/0x1f0
> > __warn from warn_slowpath_fmt+0x94/0xc8
> > warn_slowpath_fmt from check_unmap+0x704/0x980
> > check_unmap from debug_dma_unmap_page+0x8c/0x9c
> > debug_dma_unmap_page from moxart_mac_free_memory+0x3c/0xa8
> > moxart_mac_free_memory from moxart_mac_probe+0x190/0x218
> > moxart_mac_probe from platform_probe+0x48/0x88
> > platform_probe from really_probe+0xc0/0x2e4
> >
> > Fixes: 6c821bd9edc9 ("net: Add MOXA ART SoCs ethernet driver")
> > Signed-off-by: Sergei Antonov <saproj@...il.com>
>
> This looks correct as it is:
>
> Reviewed-by: Andrew Lunn <andrew@...n.ch>
>
> But i do wonder how it go into the situation:
An error during moxart_mac_probe() does "goto init_fail;" which calls
moxart_mac_free_memory(). And by that time, priv->rx_mapping[i] are
all zero yet.
Powered by blists - more mailing lists