lkml.org 
[lkml]   [2023]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] net: ll_temac: improve reset of buffer on dma mapping
Date
Jakub Kicinski <kuba@kernel.org> writes:

> On Thu, 26 Jan 2023 11:16:07 +0100 Jonas Suhr Christensen wrote:
>> Free buffer and set pointer to null on dma mapping error.
>
> Why? I don't see a leak. You should provide motivation in the commit
> message.

I don't think there is a leak. But if one of the dma_map_single() calls
in temac_dma_bd_init() fails, the error handling calls into
temac_dma_bd_release(), which will then call dma_unmap_single() on the
address that failed to be mapped.

Can we be sure that doing so is always safe? If not, this change
ensures that we only unmap buffers that were succesfully mapped.

/Esben

\
 
 \ /
  Last update: 2023-03-27 00:01    [W:0.065 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site