Skip to content

Commit d557c09

Browse files
emuslndavem330
authored andcommitted
pds_core: keep viftypes table across reset
Keep the viftypes and the current enable/disable states across a recovery action. Signed-off-by: Shannon Nelson <[email protected]> Reviewed-by: Brett Creeley <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f7b5bd7 commit d557c09

File tree

1 file changed

+9
-6
lines changed
  • drivers/net/ethernet/amd/pds_core

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,13 @@ int pdsc_setup(struct pdsc *pdsc, bool init)
445445
goto err_out_teardown;
446446

447447
/* Set up the VIFs */
448-
err = pdsc_viftypes_init(pdsc);
449-
if (err)
450-
goto err_out_teardown;
448+
if (init) {
449+
err = pdsc_viftypes_init(pdsc);
450+
if (err)
451+
goto err_out_teardown;
451452

452-
if (init)
453453
pdsc_debugfs_add_viftype(pdsc);
454+
}
454455

455456
clear_bit(PDSC_S_FW_DEAD, &pdsc->state);
456457
return 0;
@@ -469,8 +470,10 @@ void pdsc_teardown(struct pdsc *pdsc, bool removing)
469470
pdsc_qcq_free(pdsc, &pdsc->notifyqcq);
470471
pdsc_qcq_free(pdsc, &pdsc->adminqcq);
471472

472-
kfree(pdsc->viftype_status);
473-
pdsc->viftype_status = NULL;
473+
if (removing) {
474+
kfree(pdsc->viftype_status);
475+
pdsc->viftype_status = NULL;
476+
}
474477

475478
if (pdsc->intr_info) {
476479
for (i = 0; i < pdsc->nintrs; i++)

0 commit comments

Comments
 (0)