net: mvpp2: Return -ENOMEM for failed alloc
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 5 Aug 2025 14:18:17 +0000 (15:18 +0100)
committerJerome Forissier <jerome.forissier@linaro.org>
Mon, 18 Aug 2025 13:47:57 +0000 (15:47 +0200)
Instead of returning -1 on a failed alloc, return -ENOMEM.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/net/mvpp2.c

index c032834..b68d305 100644 (file)
@@ -2329,7 +2329,7 @@ static int mvpp2_prs_mac_da_accept(struct mvpp2 *priv, int port,
 
                pe = kzalloc(sizeof(*pe), GFP_KERNEL);
                if (!pe)
-                       return -1;
+                       return -ENOMEM;
                mvpp2_prs_tcam_lu_set(pe, MVPP2_PRS_LU_MAC);
                pe->index = tid;