Skip to contentSkip to conversation

vhost-vdpa:fix the worng input in config_cb

PATCH Superseded Cindy Lu 2 participants 3 messages Sep 29, 2021

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Cindy Lu

author
#0 lore raw

PATCH 1/1 vhost-vdpa:fix the worng input in config_cb

Fix the worng input in for config_cb, in function vhost_vdpa_config_cb, the input cb.private was used as struct vhost_vdpa, So the inuput was worng here, fix this issue

---
 drivers/vhost/vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vdpa.c +1 -1
index 942666425a45..e532cbe3d2f7 100644
@@ -322,7 +322,7 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)
 	struct eventfd_ctx *ctx;
 
 	cb.callback = vhost_vdpa_config_cb;
-	cb.private = v->vdpa;
+	cb.private = v;
 	if (copy_from_user(&fd, argp, sizeof(fd)))
 		return  -EFAULT;
 
Signature · 1 line
2.21.3
#1 lore raw
Quoted 6 lines · Cindy Lu

Fix the worng input in for config_cb, in function vhost_vdpa_config_cb, the input cb.private was used as struct vhost_vdpa, So the inuput was worng here, fix this issue

Maybe add

Fixes 776f395004d8 ("vhost_vdpa: Support config interrupt in vdpa")

and fix typos in the commit log.

Quoted 19 lines
---
 drivers/vhost/vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vdpa.c +1 -1
index 942666425a45..e532cbe3d2f7 100644
@@ -322,7 +322,7 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)
 	struct eventfd_ctx *ctx;
 
 	cb.callback = vhost_vdpa_config_cb;
-	cb.private = v->vdpa;
+	cb.private = v;
 	if (copy_from_user(&fd, argp, sizeof(fd)))
 		return  -EFAULT;
 
Signature · 1 line
2.21.3

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

author
#2 lore raw
Quoted 7 lines · Michael S. Tsirkin
Quoted 5 lines · Cindy Lu

Fix the worng input in for config_cb, in function vhost_vdpa_config_cb, the input cb.private was used as struct vhost_vdpa, So the inuput was worng here, fix this issue

Quoted 8 lines
Quoted 1 line

Maybe add

Fixes 776f395004d8 ("vhost_vdpa: Support config interrupt in vdpa")

and fix typos in the commit log.

thanks Michael, I will post a new version

Quoted 20 lines
Quoted 19 lines
---
 drivers/vhost/vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vdpa.c +1 -2
index 942666425a45..e532cbe3d2f7 100644
@@ -322,7 +322,7 @@ static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp)
      struct eventfd_ctx *ctx;
 
      cb.callback = vhost_vdpa_config_cb;
-     cb.private = v->vdpa;
+     cb.private = v;
      if (copy_from_user(&fd, argp, sizeof(fd)))
              return  -EFAULT;
 
--

2.21.3