]> git.baikalelectronics.ru Git - kernel.git/commit
drm/panel: type promotion bug in s6e8aa0_read_mtp_id()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 4 Jul 2018 09:38:09 +0000 (12:38 +0300)
committerThierry Reding <treding@nvidia.com>
Tue, 10 Jul 2018 15:59:05 +0000 (17:59 +0200)
commit5e2ac1eb23571aff16114b3a9d400e9067ff401f
tree07abaab8e13ad3597cd460ae910e7bddaf562b86
parent6fb36bf150c6040d654cfdfa5206c6d63e2d0005
drm/panel: type promotion bug in s6e8aa0_read_mtp_id()

The ARRAY_SIZE() macro is type size_t.  If s6e8aa0_dcs_read() returns a
negative error code, then "ret < ARRAY_SIZE(id)" is false because the
negative error code is type promoted to a high positive value.

Fixes: ed1b5ade0e38 ("drm/panel: add S6E8AA0 driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180704093807.s3lqsb2v6dg2k43d@kili.mountain
drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c