Skip to content
Commit 544ee730 authored by Tom Rix's avatar Tom Rix Committed by Mauro Carvalho Chehab
Browse files

media: atomisp: improve error handling in gc2235_detect()

Static analysis reports this representative problem

atomisp-gc2235.c:867:20: warning: The right operand
  of '|' is a garbage value
        id = ((high << 8) | low);
                          ^ ~~~
When gc2235_read_reg() fails, its return val is never written.

For gc2235_detect(), high and low are or-ed and compared
with GC2235_ID, 0x2235.  Initialize both to 0 and skip
checking the read returns, it's errors are not passed up, only
-ENODEV is.

Link: https://lore.kernel.org/linux-media/20210521194805.2078135-1-trix@redhat.com


Signed-off-by: default avatarTom Rix <trix@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f89aa0d1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment