Skip to content

Commit 969cfd4

Browse files
emuslnkuba-moo
authored andcommitted
pds_core: check for work queue before use
Add a check that the wq exists before queuing up work for a failed devcmd, as the PF is responsible for health and the VF doesn't have a wq. Fixes: c2dbb09 ("pds_core: health timer and workqueue") Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Brett Creeley <brett.creeley@amd.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20230824161754.34264-5-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 95e3832 commit 969cfd4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/net/ethernet/amd/pds_core

drivers/net/ethernet/amd/pds_core/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ int pdsc_devcmd_locked(struct pdsc *pdsc, union pds_core_dev_cmd *cmd,
183183
err = pdsc_devcmd_wait(pdsc, max_seconds);
184184
memcpy_fromio(comp, &pdsc->cmd_regs->comp, sizeof(*comp));
185185

186-
if (err == -ENXIO || err == -ETIMEDOUT)
186+
if ((err == -ENXIO || err == -ETIMEDOUT) && pdsc->wq)
187187
queue_work(pdsc->wq, &pdsc->health_work);
188188

189189
return err;

0 commit comments

Comments
 (0)