diff mbox

drm/i915: fix noderef.cocci warnings

Message ID 20170616190757.GA12638@lkp-ib03.lkp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fengguang Wu June 16, 2017, 7:07 p.m. UTC
drivers/gpu/drm/i915/i915_gem_execbuffer.c:1224:54-60: ERROR: application of sizeof to pointer

 sizeof when applied to a pointer typed expression gives the size of
 the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 i915_gem_execbuffer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1221,7 +1221,7 @@  static int eb_relocate_vma(struct i915_e
 	 * to read. However, if the array is not writable the user loses
 	 * the updated relocation values.
 	 */
-	if (unlikely(!access_ok(VERIFY_READ, urelocs, remain*sizeof(urelocs))))
+	if (unlikely(!access_ok(VERIFY_READ, urelocs, remain*sizeof(*urelocs))))
 		return -EFAULT;
 
 	do {