summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-06-28 15:20:43 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-07-18 15:39:27 +0200
commit74f20788a7637f03bb877a178ef2c8f34a722c26 (patch)
tree0c2e8decb3263551dd86085d79f3012630c562ee
parent2aa9d2bc8cc3ab32ea0d15ec9005f25b1af3465a (diff)
downloadblackbird-op-linux-74f20788a7637f03bb877a178ef2c8f34a722c26.tar.gz
blackbird-op-linux-74f20788a7637f03bb877a178ef2c8f34a722c26.zip
drivers/gpu/drm/drm_buffer.c: remove unnecessary null test before kfree
This patch removes special case of last element and loops from idx to 0. Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_buffer.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_buffer.c b/drivers/gpu/drm/drm_buffer.c
index 0406110f83ed..86a4a4a60afc 100644
--- a/drivers/gpu/drm/drm_buffer.c
+++ b/drivers/gpu/drm/drm_buffer.c
@@ -80,11 +80,7 @@ int drm_buffer_alloc(struct drm_buffer **buf, int size)
error_out:
- /* Only last element can be null pointer so check for it first. */
- if ((*buf)->data[idx])
- kfree((*buf)->data[idx]);
-
- for (--idx; idx >= 0; --idx)
+ for (; idx >= 0; --idx)
kfree((*buf)->data[idx]);
kfree(*buf);
OpenPOWER on IntegriCloud