Skip to content

Commit cb4a907

Browse files
Erni Sri Satya VennelaPaolo Abeni
authored andcommitted
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: 54133f9 ("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>
1 parent 7079c8c commit cb4a907

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/ethernet/microsoft/mana/mana_en.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3631,6 +3631,8 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
36313631

36323632
ac->gdma_dev = gd;
36333633
gd->driver_data = ac;
3634+
3635+
INIT_WORK(&ac->link_change_work, mana_link_state_handle);
36343636
}
36353637

36363638
err = mana_create_eq(ac);
@@ -3648,8 +3650,6 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
36483650

36493651
if (!resuming) {
36503652
ac->num_ports = num_ports;
3651-
3652-
INIT_WORK(&ac->link_change_work, mana_link_state_handle);
36533653
} else {
36543654
if (ac->num_ports != num_ports) {
36553655
dev_err(dev, "The number of vPorts changed: %d->%d\n",

0 commit comments

Comments
 (0)