[PATCH] examples/ntb: fix the heap allocation check

Thomas Monjalon thomas at monjalon.net
Wed Jul 9 16:50:30 CEST 2025


21/05/2025 19:23, Bing Zhao:
> In some rare case, the libc memory heap allocation may fail and
> return NULL pointer. Before accessing the memory via the pointer,
> the NULL pointer check should be done to ensure the code locates
> in the safe side and no crash.
> 
> Some newer GCC version will check this by default and report warning
> on this. Adding the NULL pointer check will help to get rid of such
> warning.
> 
> Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
> Cc: xiaoyun.li at intel.com
> 
> Signed-off-by: Bing Zhao <bingz at nvidia.com>

Applied, thanks.




More information about the dev mailing list