Skip to content

Commit dd3b8de

Browse files
emuslnmstsirkin
authored andcommitted
pds_vdpa: clear config callback when status goes to 0
If the client driver is setting status to 0, something is getting shutdown and possibly removed. Make sure we clear the config_cb so that it doesn't end up crashing when trying to call a bogus callback. Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Message-Id: <20231110221802.46841-3-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com>
1 parent 4f317d6 commit dd3b8de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/vdpa/pds/vdpa_dev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,10 @@ static void pds_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)
461461

462462
pds_vdpa_cmd_set_status(pdsv, status);
463463

464-
/* Note: still working with FW on the need for this reset cmd */
465464
if (status == 0) {
465+
struct vdpa_callback null_cb = { };
466+
467+
pds_vdpa_set_config_cb(vdpa_dev, &null_cb);
466468
pds_vdpa_cmd_reset(pdsv);
467469

468470
for (i = 0; i < pdsv->num_vqs; i++) {

0 commit comments

Comments
 (0)