diff options
author | Shannon Nelson <shannon.nelson@amd.com> | 2023-08-24 09:17:53 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-08-25 19:05:58 -0700 |
commit | 969cfd4c8ca50c32901342cdd3d677c3ffe61371 (patch) | |
tree | 20bef559a1ff86076d34e2badbb28d42fa6bf204 /drivers/net/ethernet | |
parent | 95e383226d6fcda6c217912f11edf8d74de9cc85 (diff) | |
download | linux-stable-969cfd4c8ca50c32901342cdd3d677c3ffe61371.tar.gz linux-stable-969cfd4c8ca50c32901342cdd3d677c3ffe61371.tar.bz2 linux-stable-969cfd4c8ca50c32901342cdd3d677c3ffe61371.zip |
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: c2dbb0904310 ("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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/amd/pds_core/dev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/amd/pds_core/dev.c b/drivers/net/ethernet/amd/pds_core/dev.c index debe5216fe29..524f422ee7ac 100644 --- a/drivers/net/ethernet/amd/pds_core/dev.c +++ b/drivers/net/ethernet/amd/pds_core/dev.c @@ -183,7 +183,7 @@ int pdsc_devcmd_locked(struct pdsc *pdsc, union pds_core_dev_cmd *cmd, err = pdsc_devcmd_wait(pdsc, max_seconds); memcpy_fromio(comp, &pdsc->cmd_regs->comp, sizeof(*comp)); - if (err == -ENXIO || err == -ETIMEDOUT) + if ((err == -ENXIO || err == -ETIMEDOUT) && pdsc->wq) queue_work(pdsc->wq, &pdsc->health_work); return err; |