v2 2026-07-26

移除GFP_NOFAIL后空检查 · v2

移除__GFP_NOFAIL分配后不可达的NULL检查,并修复xive_ipis释放后使用及错误传播。

原始补丁链接

子 Patch(6)

1/6
powerpc/xive: remove dead NULL check after GFP_NOFAIL allocation
kzalloc_objs with the __GFP_NOFAIL flag will never return NULL, so the subsequent NULL check is unreachable dead code. Remove it. Signed-off-by: Gou Hao gouhao@uniontech.com Reviewed-by: Wentao Gua
2/6
powerpc/xive: add error return value to xive_smp_probe()
xive_smp_probe() calls xive_init_ipis() which can fail, but its return value is currently ignored. Change xive_smp_probe() to return int so that errors can be propagated to callers. This is a prepar
3/6
powerpc/xive: fix use-after-free of xive_ipis
When irq_domain_alloc_irqs() fails in xive_init_ipis(), the error path frees the global xive_ipis array via kfree(). However, xive_smp_probe() ignores the error return and proceeds to call xive_setup
4/6
drm: remove dead WARN_ON NULL check after GFP_NOFAIL allocation
kzalloc_obj with the __GFP_NOFAIL flag will never return NULL, so the subsequent WARN_ON(!ctx) is unreachable dead code. Remove it. Signed-off-by: Gou Hao gouhao@uniontech.com — drivers/gpu/drm/
5/6
lib/test_hmm: remove dead NULL checks after GFP_NOFAIL allocations
kvcalloc with the __GFP_NOFAIL flag will never return NULL, so the subsequent NULL checks are unreachable dead code. Remove them. Signed-off-by: Gou Hao gouhao@uniontech.com — lib/test_hmm.c | 6
6/6
RDMA/cxgb4: remove dead NULL checks after GFP_NOFAIL allocations
alloc_skb() with the __GFP_NOFAIL flag will never return NULL, so the subsequent NULL checks and error handling are unreachable dead code. Remove them. Signed-off-by: Gou Hao gouhao@uniontech.com -