Commit af1ac18a authored by Dan Carpenter's avatar Dan Carpenter Committed by Ben Skeggs

drm/nouveau/disp: sizeof() wrong pointer

"data" is a void pointer and "args" is "data" after we have casted it to
a struct.  We care about the size of the struct here.  Btw,
sizeof(*data) is 1.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 264ce192
...@@ -333,7 +333,7 @@ nv50_disp_sync_ctor(struct nouveau_object *parent, ...@@ -333,7 +333,7 @@ nv50_disp_sync_ctor(struct nouveau_object *parent,
struct nv50_disp_dmac *dmac; struct nv50_disp_dmac *dmac;
int ret; int ret;
if (size < sizeof(*data) || args->head > 1) if (size < sizeof(*args) || args->head > 1)
return -EINVAL; return -EINVAL;
ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf, ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf,
...@@ -372,7 +372,7 @@ nv50_disp_ovly_ctor(struct nouveau_object *parent, ...@@ -372,7 +372,7 @@ nv50_disp_ovly_ctor(struct nouveau_object *parent,
struct nv50_disp_dmac *dmac; struct nv50_disp_dmac *dmac;
int ret; int ret;
if (size < sizeof(*data) || args->head > 1) if (size < sizeof(*args) || args->head > 1)
return -EINVAL; return -EINVAL;
ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf, ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf,
......
...@@ -228,7 +228,7 @@ nvd0_disp_sync_ctor(struct nouveau_object *parent, ...@@ -228,7 +228,7 @@ nvd0_disp_sync_ctor(struct nouveau_object *parent,
struct nv50_disp_dmac *dmac; struct nv50_disp_dmac *dmac;
int ret; int ret;
if (size < sizeof(*data) || args->head >= priv->head.nr) if (size < sizeof(*args) || args->head >= priv->head.nr)
return -EINVAL; return -EINVAL;
ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf, ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf,
...@@ -268,7 +268,7 @@ nvd0_disp_ovly_ctor(struct nouveau_object *parent, ...@@ -268,7 +268,7 @@ nvd0_disp_ovly_ctor(struct nouveau_object *parent,
struct nv50_disp_dmac *dmac; struct nv50_disp_dmac *dmac;
int ret; int ret;
if (size < sizeof(*data) || args->head >= priv->head.nr) if (size < sizeof(*args) || args->head >= priv->head.nr)
return -EINVAL; return -EINVAL;
ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf, ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment