]> git.ipfire.org Git - people/arne_f/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2018 06:36:40 +0000 (08:36 +0200)
commit2c814276d1ef9b3fb44a48916f16664ab8c54e5f
treeb97238829548c7914072eebdb96027b3fb8af36b
parent18e589f6a0591296a9483aa91187f2ccc4e0b616
drm/panel: type promotion bug in s6e8aa0_read_mtp_id()

[ Upstream commit cd0e0ca69109d025b1a1b6609f70682db62138b0 ]

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: 02051ca06371 ("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
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c