[PATCH] vhost-vdpa:fix the worng input in config_cb

Subsystems: the rest, virtio host (vhost)

STALE1768d

3 messages, 2 authors, 2021-09-29 · open the first message on its own page

[PATCH] vhost-vdpa:fix the worng input in config_cb

From: Cindy Lu <hidden>
Date: 2021-09-29 07:57:54

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

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 942666425a45..e532cbe3d2f7 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -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

Re: [PATCH] vhost-vdpa:fix the worng input in config_cb

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2021-09-29 08:32:35

On Wed, Sep 29, 2021 at 03:54:37PM +0800, Cindy Lu wrote:
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

Signed-off-by: Cindy Lu <redacted>
Maybe add

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

and fix typos in the commit log.
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 942666425a45..e532cbe3d2f7 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -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

Re: [PATCH] vhost-vdpa:fix the worng input in config_cb

From: Cindy Lu <hidden>
Date: 2021-09-29 08:52:14

On Wed, Sep 29, 2021 at 4:32 PM Michael S. Tsirkin [off-list ref] wrote:
On Wed, Sep 29, 2021 at 03:54:37PM +0800, Cindy Lu wrote:
quoted
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

Signed-off-by: Cindy Lu <redacted>
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
---
 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 942666425a45..e532cbe3d2f7 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -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

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