From: Shannon Nelson Date: Fri, 10 Nov 2023 22:18:01 +0000 (-0800) Subject: pds_vdpa: clear config callback when status goes to 0 X-Git-Tag: v6.6.17~1468 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3bb92beda4af03bb0779f89d2efdadf6ca74b10;p=platform%2Fkernel%2Flinux-rpi.git pds_vdpa: clear config callback when status goes to 0 [ Upstream commit dd3b8de16e90c5594eddd29aeeb99e97c6f863be ] 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 Message-Id: <20231110221802.46841-3-shannon.nelson@amd.com> Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Signed-off-by: Sasha Levin --- diff --git a/drivers/vdpa/pds/vdpa_dev.c b/drivers/vdpa/pds/vdpa_dev.c index 52b2449..9fc89c8 100644 --- a/drivers/vdpa/pds/vdpa_dev.c +++ b/drivers/vdpa/pds/vdpa_dev.c @@ -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++) {