]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
media: atomisp: do not use err var when checking port validity for ISP2400
authorTsuchiya Yuto <kitakar@gmail.com>
Sun, 17 Oct 2021 16:19:44 +0000 (01:19 +0900)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 09:59:13 +0000 (10:59 +0100)
commit3b87334730aa2526d149ab0a4028eab5894535ed
treebb059388a26adf8a253488b1eee485c3de6ae1e3
parentf1f3f599f94543353fe673d00ae6e4848b40ea92
media: atomisp: do not use err var when checking port validity for ISP2400

BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit 9f6b4fa2d2dfbff4b8a57eeb39b1128a6094ee20 ]

Currently, the `port >= N_CSI_PORTS || err` checks for ISP2400 are always
evaluated as true because the err variable is set to `-EINVAL` on
declaration but the variable is never used until the evaluation.

Looking at the diff of commit 3c0538fbad9f ("media: atomisp: get rid of
most checks for ISP2401 version"), the `port >= N_CSI_PORTS` check is
for ISP2400 and the err variable check is for ISP2401. Fix this issue
by adding ISP version test there accordingly.

Fixes: 3c0538fbad9f ("media: atomisp: get rid of most checks for ISP2401 version")
Signed-off-by: Tsuchiya Yuto <kitakar@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/staging/media/atomisp/pci/sh_css_mipi.c