media: atomisp: fix "variable dereferenced before check 'asd'"
authorTsuchiya Yuto <kitakar@gmail.com>
Wed, 1 Dec 2021 14:19:04 +0000 (15:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:36 +0000 (11:04 +0100)
commit6aaff2d7c9d52ae523ca318639c7dc74e751dc88
tree7571fb08873e46f1d1dabfe1740b038c63b89bf8
parenta2e962b2d8b072f965abbd3b2f37984f0e7b2714
media: atomisp: fix "variable dereferenced before check 'asd'"

[ Upstream commit ac56760a8bbb4e654b2fd54e5de79dd5d72f937d ]

There are two occurrences where the variable 'asd' is dereferenced
before check. Fix this issue by using the variable after the check.

Link: https://lore.kernel.org/linux-media/20211122074122.GA6581@kili/
Link: https://lore.kernel.org/linux-media/20211201141904.47231-1-kitakar@gmail.com
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
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/atomisp_cmd.c
drivers/staging/media/atomisp/pci/atomisp_ioctl.c