Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Fabian Frederick and committed by
Daniel Vetter
74f20788 2aa9d2bc

+1 -5
+1 -5
drivers/gpu/drm/drm_buffer.c
··· 80 80 81 81 error_out: 82 82 83 - /* Only last element can be null pointer so check for it first. */ 84 - if ((*buf)->data[idx]) 85 - kfree((*buf)->data[idx]); 86 - 87 - for (--idx; idx >= 0; --idx) 83 + for (; idx >= 0; --idx) 88 84 kfree((*buf)->data[idx]); 89 85 90 86 kfree(*buf);