diff options
| author | Alok Tiwari <alok.a.tiwari@oracle.com> | 2025-12-29 21:21:18 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-01-04 09:38:55 -0800 |
| commit | a428e0da1248c353557970848994f35fd3f005e2 (patch) | |
| tree | 10c2b555c9411e185a78398e80dff1701b5bdd9b /tools/lib/python/git@git.tavy.me:linux.git | |
| parent | dbf8fe85a16a33d6b6bd01f2bc606fc017771465 (diff) | |
net: marvell: prestera: fix NULL dereference on devlink_alloc() failure
devlink_alloc() may return NULL on allocation failure, but
prestera_devlink_alloc() unconditionally calls devlink_priv() on
the returned pointer.
This leads to a NULL pointer dereference if devlink allocation fails.
Add a check for a NULL devlink pointer and return NULL early to avoid
the crash.
Fixes: 34dd1710f5a3 ("net: marvell: prestera: Add basic devlink support")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Acked-by: Elad Nachman <enachman@marvell.com>
Link: https://patch.msgid.link/20251230052124.897012-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/lib/python/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
