Skip to content

Commit e48b894

Browse files
emuslnkuba-moo
authored andcommitted
pds_core: no health reporter in VF
Make sure the health reporter is set up before we use it in our devlink health updates, especially since the VF doesn't set up the health reporter. Fixes: 25b450c ("pds_core: add devlink health facilities") Signed-off-by: Shannon Nelson <[email protected]> Reviewed-by: Brett Creeley <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 91202ce commit e48b894

File tree

1 file changed

+5
-3
lines changed
  • drivers/net/ethernet/amd/pds_core

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ static void pdsc_fw_down(struct pdsc *pdsc)
524524
}
525525

526526
/* Notify clients of fw_down */
527-
devlink_health_report(pdsc->fw_reporter, "FW down reported", pdsc);
527+
if (pdsc->fw_reporter)
528+
devlink_health_report(pdsc->fw_reporter, "FW down reported", pdsc);
528529
pdsc_notify(PDS_EVENT_RESET, &reset_event);
529530

530531
pdsc_stop(pdsc);
@@ -554,8 +555,9 @@ static void pdsc_fw_up(struct pdsc *pdsc)
554555

555556
/* Notify clients of fw_up */
556557
pdsc->fw_recoveries++;
557-
devlink_health_reporter_state_update(pdsc->fw_reporter,
558-
DEVLINK_HEALTH_REPORTER_STATE_HEALTHY);
558+
if (pdsc->fw_reporter)
559+
devlink_health_reporter_state_update(pdsc->fw_reporter,
560+
DEVLINK_HEALTH_REPORTER_STATE_HEALTHY);
559561
pdsc_notify(PDS_EVENT_RESET, &reset_event);
560562

561563
return;

0 commit comments

Comments
 (0)