media: atomisp: fix bad usage at error handling logic
authorMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 14 Mar 2022 17:11:38 +0000 (18:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:24:02 +0000 (14:24 +0200)
commitfe440221ca0ff17ed331b7e219e82307ca5ab5cc
tree516b0ac75fc4a7b3ed3a450c33a827dfd718f9cb
parent251a11699fe5007363cb1ae9700256a3c777a551
media: atomisp: fix bad usage at error handling logic

[ Upstream commit fc0b582c858ed73f94c8f3375c203ea46f1f7402 ]

As warned by sparse:
atomisp: drivers/staging/media/atomisp/pci/atomisp_acc.c:508 atomisp_acc_load_extensions() warn: iterator used outside loop: 'acc_fw'

The acc_fw interactor is used outside the loop, at the error handling
logic. On most cases, this is actually safe there, but, if
atomisp_css_set_acc_parameters() has an error, an attempt to use it
will pick an invalid value for acc_fw.

Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_acc.c