[PATCH] drm/i915: Don't check if a drm_file * is NULL in the ioctl code path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Right now code checkers point out that we try to dereference file before
testing it for NULL.

This check doesn't seem necessary as file needs to be valid for the
ioctl() code to run.

Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index ff47145..6573e47 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -318,9 +318,6 @@ i915_gem_context_get_hang_stats(struct intel_ring_buffer *ring,
 	if (ring->id != RCS)
 		return ERR_PTR(-EINVAL);
 
-	if (file == NULL)
-		return ERR_PTR(-EINVAL);
-
 	if (id == DEFAULT_CONTEXT_ID)
 		return &file_priv->hang_stats;
 
-- 
1.8.3.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux