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)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 18 Mar 2022 04:58:35 +0000 (05:58 +0100)
commitfc0b582c858ed73f94c8f3375c203ea46f1f7402
tree4a6d5b6ebf622cd8bc9c53c38ec4c3550ecce9e6
parent2023a99811110aebba9eee4aa09ef7bd21a8a249
media: atomisp: fix bad usage at error handling logic

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