]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm: fix unsigned comparison with less than zero
authorColin Ian King <colin.king@canonical.com>
Tue, 21 Aug 2018 11:55:19 +0000 (12:55 +0100)
committerRob Clark <robdclark@gmail.com>
Thu, 4 Oct 2018 00:24:54 +0000 (20:24 -0400)
commit1e98cc8b177851a75a278591d461b4d19f08eb7c
tree3894b00903746fbcb34fe77db254d086105038f0
parentb43ca19954aeb129bc8785c103aa4b63cce89a9c
drm/msm: fix unsigned comparison with less than zero

The return from the call to _mixer_stages can be a negative error
code however this is being assigned to an unsigned variable 'stages'
hence the check is always false. Fix this by making 'stages' an
int.

Detected by Coccinelle ("Unsigned expression compared with zero:
stages < 0")

Fixes: d7f5ce110ef6 ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c