"data" is a void pointer and "args" is "data" after we have casted it to
a struct.  We care about the sizeof the struct here.  Btw, sizeof(*data)
is 1.

Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>

diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c 
b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
index ca1a7d7..eb9c489 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nv50.c
@@ -335,7 +335,7 @@ nv50_disp_sync_ctor(struct nouveau_object *parent,
        struct nv50_disp_dmac *dmac;
        int ret;

-       if (size < sizeof(*data) || args->head > 1)
+       if (size < sizeof(*args) || args->head > 1)
                return -EINVAL;

        ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf,
@@ -374,7 +374,7 @@ nv50_disp_ovly_ctor(struct nouveau_object *parent,
        struct nv50_disp_dmac *dmac;
        int ret;

-       if (size < sizeof(*data) || args->head > 1)
+       if (size < sizeof(*args) || args->head > 1)
                return -EINVAL;

        ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf,
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c 
b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
index 9e38ebf..f28725a 100644
--- a/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/disp/nvd0.c
@@ -230,7 +230,7 @@ nvd0_disp_sync_ctor(struct nouveau_object *parent,
        struct nv50_disp_dmac *dmac;
        int ret;

-       if (size < sizeof(*data) || args->head >= priv->head.nr)
+       if (size < sizeof(*args) || args->head >= priv->head.nr)
                return -EINVAL;

        ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf,
@@ -270,7 +270,7 @@ nvd0_disp_ovly_ctor(struct nouveau_object *parent,
        struct nv50_disp_dmac *dmac;
        int ret;

-       if (size < sizeof(*data) || args->head >= priv->head.nr)
+       if (size < sizeof(*args) || args->head >= priv->head.nr)
                return -EINVAL;

        ret = nv50_disp_dmac_create_(parent, engine, oclass, args->pushbuf,

Reply via email to