diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-06-28 09:20:43 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-07-18 09:39:27 -0400 |
commit | 74f20788a7637f03bb877a178ef2c8f34a722c26 (patch) | |
tree | 0c2e8decb3263551dd86085d79f3012630c562ee /drivers/gpu/drm/drm_buffer.c | |
parent | 2aa9d2bc8cc3ab32ea0d15ec9005f25b1af3465a (diff) |
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>
Diffstat (limited to 'drivers/gpu/drm/drm_buffer.c')
-rw-r--r-- | drivers/gpu/drm/drm_buffer.c | 6 |
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) | |||
80 | 80 | ||
81 | error_out: | 81 | error_out: |
82 | 82 | ||
83 | /* Only last element can be null pointer so check for it first. */ | 83 | for (; idx >= 0; --idx) |
84 | if ((*buf)->data[idx]) | ||
85 | kfree((*buf)->data[idx]); | ||
86 | |||
87 | for (--idx; idx >= 0; --idx) | ||
88 | kfree((*buf)->data[idx]); | 84 | kfree((*buf)->data[idx]); |
89 | 85 | ||
90 | kfree(*buf); | 86 | kfree(*buf); |