Skip to content

Commit

Permalink
pds_vdpa: clear config callback when status goes to 0
Browse files Browse the repository at this point in the history
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 <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
  • Loading branch information
emusln authored and mstsirkin committed Dec 1, 2023
1 parent 4f317d6 commit dd3b8de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/vdpa/pds/vdpa_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,10 @@ static void pds_vdpa_set_status(struct vdpa_device *vdpa_dev, u8 status)

pds_vdpa_cmd_set_status(pdsv, status);

/* Note: still working with FW on the need for this reset cmd */
if (status == 0) {
struct vdpa_callback null_cb = { };

pds_vdpa_set_config_cb(vdpa_dev, &null_cb);
pds_vdpa_cmd_reset(pdsv);

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

0 comments on commit dd3b8de

Please sign in to comment.