media: camss-vfe: always initialize reg at vfe_set_xbar_cfg()
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 1 Nov 2017 12:09:59 +0000 (08:09 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Dec 2017 09:10:27 +0000 (10:10 +0100)
commitd9e497c9424896581b18f0807652364180401c7b
treef4c48dc21ab4af3b3031175654cce3d4045733db
parentde0bbe07a49ce9bf5bc4fc1846bd453151e7a334
media: camss-vfe: always initialize reg at vfe_set_xbar_cfg()

[ Upstream commit 9917fbcfa20ab987d6381fd0365665e5c1402d75 ]

if output->wm_num is bigger than 2, the value for reg is
not initialized, as warned by smatch:
drivers/media/platform/qcom/camss-8x16/camss-vfe.c:633 vfe_set_xbar_cfg() error: uninitialized symbol 'reg'.
drivers/media/platform/qcom/camss-8x16/camss-vfe.c:637 vfe_set_xbar_cfg() error: uninitialized symbol 'reg'.

That shouldn't happen in practice, so add a logic that will
break the loop if i > 1, fixing the warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Todor Tomov <todor.tomov@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/qcom/camss-8x16/camss-vfe.c