summaryrefslogtreecommitdiffstats
path: root/drivers/vhost/vdpa.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2022-01-10 09:56:57 +0100
committerJiri Kosina <jkosina@suse.cz>2022-01-10 09:56:57 +0100
commit3551a3ff8229e15d2a4b47b8234923bc72da65ef (patch)
treea62465753397b0268529a5d0b9ab43a8840069ad /drivers/vhost/vdpa.c
parent906095af85e8b2e53ee9f8c50b3dff365aa09df8 (diff)
parent33a5c2793451770cb6dcf0cc35c76cfd4b045513 (diff)
downloadlinux-3551a3ff8229e15d2a4b47b8234923bc72da65ef.tar.bz2
Merge branch 'for-5.17/letsketch' into for-linus
- new driver to support for LetSketch device (Hans de Goede)
Diffstat (limited to 'drivers/vhost/vdpa.c')
-rw-r--r--drivers/vhost/vdpa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index 29cced1cd277..e3c4f059b21a 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -197,7 +197,7 @@ static int vhost_vdpa_config_validate(struct vhost_vdpa *v,
struct vdpa_device *vdpa = v->vdpa;
long size = vdpa->config->get_config_size(vdpa);
- if (c->len == 0)
+ if (c->len == 0 || c->off > size)
return -EINVAL;
if (c->len > size - c->off)