From: Manuel Janocha am65_cpsw_nuss_probe() allocates the buffer for the ALE table that suspend saves and resume restores, but does not check the result. If the allocation fails, probe succeeds and the next system suspend writes the ALE table through a NULL pointer in cpsw_ale_dump(), and resume reads it back through the same pointer in cpsw_ale_restore(). Fail the probe with -ENOMEM instead. Testing: compile-tested only (arm64, W=1). Tooling: this patch was prepared with an AI coding assistant (Claude). Fixes: 020b232f79e9 ("net: ethernet: ti: am65-cpsw: Fix hardware switch mode on suspend/resume") Signed-off-by: Manuel Janocha --- drivers/net/ethernet/ti/am65-cpsw-nuss.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c index 0ad614582244..08fa397b10ab 100644 --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c @@ -3639,6 +3639,11 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev) common->ale_context = devm_kzalloc(dev, ale_entries * ALE_ENTRY_WORDS * sizeof(u32), GFP_KERNEL); + if (!common->ale_context) { + ret = -ENOMEM; + goto err_of_clear; + } + ret = am65_cpsw_init_cpts(common); if (ret) goto err_of_clear; --- base-commit: 3c8881ee98069d3c8a1a0ad1fd6efd726e466297 change-id: 20261204-am65-ale-context-nomem-fe58b7b5d6a3 Best regards, -- Manuel Janocha