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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:08 +0000 (11:03 +0100)
commit4de485f6d5fedc00c3b98ac38587afdbd61c28c6
treeee43d0794d8ba10f52607307d4afaa9d0cb4b89f
parentb7033740e36783e54d83984dd4c00c4e535de004
media: atomisp: do not use err var when checking port validity for ISP2400

[ 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>
drivers/staging/media/atomisp/pci/sh_css_mipi.c