Skip to content

Commit 91202ce

Browse files
emuslnkuba-moo
authored andcommitted
pds_core: protect devlink callbacks from fw_down state
Don't access structs that have been cleared when in the fw_down state and the various structs have been cleaned and are waiting to recover. This caused a panic on rmmod when already in fw_down and devlink_param_unregister() tried to check the parameters. Fixes: 40ced89 ("pds_core: devlink params for enabling VIF support") 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-2-shannon.nelson@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent b3d26c5 commit 91202ce

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ pdsc_viftype *pdsc_dl_find_viftype_by_id(struct pdsc *pdsc,
1010
{
1111
int vt;
1212

13+
if (!pdsc->viftype_status)
14+
return NULL;
15+
1316
for (vt = 0; vt < PDS_DEV_TYPE_MAX; vt++) {
1417
if (pdsc->viftype_status[vt].dl_id == dl_id)
1518
return &pdsc->viftype_status[vt];

0 commit comments

Comments
 (0)