]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: mana: Init link_change_work before potential error paths in probe
authorErni Sri Satya Vennela <ernis@linux.microsoft.com>
Mon, 20 Apr 2026 12:47:35 +0000 (05:47 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 23 Apr 2026 10:49:13 +0000 (12:49 +0200)
commitcb4a90744bcd1adf12f0d0c7c4f0dd2647444ec5
tree471de93200d6ce32d51d9699bd51aef1130bd3e9
parent7079c8c13f2d33992bc846240517d88f4ab07781
net: mana: Init link_change_work before potential error paths in probe

Move INIT_WORK(link_change_work) to right after the mana_context
allocation, before any error path that could reach mana_remove().

Previously, if mana_create_eq() or mana_query_device_cfg() failed,
mana_probe() would jump to the error path which calls mana_remove().
mana_remove() unconditionally calls disable_work_sync(link_change_work),
but the work struct had not been initialized yet. This can trigger
CONFIG_DEBUG_OBJECTS_WORK enabled.

Fixes: 54133f9b4b53 ("net: mana: Support HW link state events")
Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Link: https://patch.msgid.link/20260420124741.1056179-2-ernis@linux.microsoft.com
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/microsoft/mana/mana_en.c