[PATCH 2/3] treewide: use dma_xalloc()/dma_xzalloc() where the result isn't checked

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Oct 16 03:35:10 PDT 2026



On 10/16/26 9:36 AM, Sascha Hauer wrote:
> dma_alloc() and dma_zalloc() are going to return NULL on allocation
> failure. Switch all callers that don't check for NULL over to the
> dma_xalloc() and dma_xzalloc() variants, so they keep panicking on
> OOM instead of dereferencing a NULL pointer.
> 
> This includes kmalloc(), kzalloc() and kcalloc(), so the many users of
> these wrappers that don't check their result keep working as before,
> net_alloc_packet(), and the two ext4 symlink allocations that use the
> zalloc() alias without checking.
> 
> Callers that check the result of dma_alloc() and dma_zalloc() already
> are left as they are.
> 
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>

Reviewed-by: Ahmad Fatoum <a.fatoum at pengutronix.de>

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |




More information about the barebox mailing list