Re: [PATCH net] qede: confirm skb is allocated before using

From: Jakub Kicinski
Date: Thu Apr 07 2022 - 02:02:22 EST


On Wed, 6 Apr 2022 11:58:09 +1000 Jamie Bainbridge wrote:
> qede_build_skb() assumes build_skb() always works and goes straight
> to skb_reserve(). However, build_skb() can fail under memory pressure.
> This results in a kernel panic because the skb to reserve is NULL.
>
> Add a check in case build_skb() failed to allocate and return NULL.
>
> The NULL return is handled correctly in callers to qede_build_skb().
>
> Fixes: 8a8633978b842 ("qede: Add build_skb() support.")
> Signed-off-by: Jamie Bainbridge <jamie.bainbridge@xxxxxxxxx>

FTR commit 4e910dbe3650 ("qede: confirm skb is allocated before using")
in net.