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

drm/layerscape: fix handling fsl_dcu_drm_plane_index result

The function can return negative value.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2038576

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Andrzej Hajda and committed by
Dave Airlie
14d11b8d 728f8660

+2 -1
+2 -1
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c
··· 58 58 struct drm_plane_state *old_state) 59 59 { 60 60 struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private; 61 - unsigned int index, value, ret; 61 + unsigned int value; 62 + int index, ret; 62 63 63 64 index = fsl_dcu_drm_plane_index(plane); 64 65 if (index < 0)