[PATCH] drm: avoid passing null pointer to memset

2012-10-10 Thread Chris Wilson
On Tue, 9 Oct 2012 16:56:58 -0300, Rodrigo Vivi wrote: > When cmd isn't IOC_IN | IOC_OUT a null "kdata" goes to "memset", which > dereferences it. > > v2: simpler version just using usize = 0 instead of allocating useless memory > > Signed-off-by: Rodrigo Vivi Presuming that coverity is sma

Re: [PATCH] drm: avoid passing null pointer to memset

2012-10-10 Thread Chris Wilson
On Tue, 9 Oct 2012 16:56:58 -0300, Rodrigo Vivi wrote: > When cmd isn't IOC_IN | IOC_OUT a null "kdata" goes to "memset", which > dereferences it. > > v2: simpler version just using usize = 0 instead of allocating useless memory > > Signed-off-by: Rodrigo Vivi Presuming that coverity is smar

[PATCH] drm: avoid passing null pointer to memset

2012-10-09 Thread Chris Wilson
On Tue, 9 Oct 2012 14:50:46 -0300, Rodrigo Vivi wrote: > When cmd isn't IOC_IN | IOC_OUT a null "kdata" goes to "memset", which > dereferences it. > usize should be 0 in that case, since the ioctl is neither copying data in or out, for example I915_GEM_THROTTLE. To be on the safe side: if (IOC

[PATCH] drm: avoid passing null pointer to memset

2012-10-09 Thread Rodrigo Vivi
When cmd isn't IOC_IN | IOC_OUT a null "kdata" goes to "memset", which dereferences it. v2: simpler version just using usize = 0 instead of allocating useless memory Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/

[PATCH] drm: avoid passing null pointer to memset

2012-10-09 Thread Rodrigo Vivi
When cmd isn't IOC_IN | IOC_OUT a null "kdata" goes to "memset", which dereferences it. Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/drm_drv.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 1490e76..59

[PATCH] drm: avoid passing null pointer to memset

2012-10-09 Thread Rodrigo Vivi
When cmd isn't IOC_IN | IOC_OUT a null "kdata" goes to "memset", which dereferences it. v2: simpler version just using usize = 0 instead of allocating useless memory Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/

Re: [PATCH] drm: avoid passing null pointer to memset

2012-10-09 Thread Chris Wilson
On Tue, 9 Oct 2012 14:50:46 -0300, Rodrigo Vivi wrote: > When cmd isn't IOC_IN | IOC_OUT a null "kdata" goes to "memset", which > dereferences it. > usize should be 0 in that case, since the ioctl is neither copying data in or out, for example I915_GEM_THROTTLE. To be on the safe side: if (IOC_

[PATCH] drm: avoid passing null pointer to memset

2012-10-09 Thread Rodrigo Vivi
When cmd isn't IOC_IN | IOC_OUT a null "kdata" goes to "memset", which dereferences it. Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/drm_drv.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 1490e76..59