summaryrefslogtreecommitdiff
path: root/drivers/vdpa
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@amd.com>2023-11-11 01:18:01 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-20 13:51:41 +0300
commitd3bb92beda4af03bb0779f89d2efdadf6ca74b10 (patch)
tree34bd56776ca164bdc4d55def723d5fa3d52384a9 /drivers/vdpa
parent53fff954e77c9bd0c186e46f396807da630c4765 (diff)
downloadlinux-d3bb92beda4af03bb0779f89d2efdadf6ca74b10.tar.xz
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 <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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/vdpa')
-rw-r--r--drivers/vdpa/pds/vdpa_dev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/vdpa/pds/vdpa_dev.c b/drivers/vdpa/pds/vdpa_dev.c
index 52b2449182ad..9fc89c82d1f0 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++) {