[PATCH v3] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

Subsystems: the rest, virtio host (vhost)

STALE2030d

2 messages, 2 authors, 2021-01-26 · open the first message on its own page

[PATCH v3] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

From: Cindy Lu <hidden>
Date: 2021-01-26 17:28:24

In vhost_vdpa_set_config_call, the cb.private should be vhost_vdpa.
this cb.private will finally use in vhost_vdpa_config_cb as
vhost_vdpa. Fix this issue.

Cc: stable@vger.kernel.org
Fixes: 776f395004d82 ("vhost_vdpa: Support config interrupt in vdpa")
Signed-off-by: Cindy Lu <redacted>
---
 drivers/vhost/vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index ef688c8c0e0e..3fbb9c1f49da 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -319,7 +319,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

Re: [PATCH v3] vhost_vdpa: fix the problem in vhost_vdpa_set_config_call

From: Jason Wang <hidden>
Date: 2021-01-26 17:51:00

On 2021/1/26 下午3:16, Cindy Lu wrote:
In vhost_vdpa_set_config_call, the cb.private should be vhost_vdpa.
this cb.private will finally use in vhost_vdpa_config_cb as
vhost_vdpa. Fix this issue.

Cc: stable@vger.kernel.org
Fixes: 776f395004d82 ("vhost_vdpa: Support config interrupt in vdpa")
Signed-off-by: Cindy Lu <redacted>

Acked-by: Jason Wang <redacted>

quoted hunk
---
  drivers/vhost/vdpa.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index ef688c8c0e0e..3fbb9c1f49da 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -319,7 +319,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;
  

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help