DaVinci-VPFE-Capture: fix error handling
authorArnd Bergmann <arnd@arndb.de>
Tue, 22 Nov 2016 20:52:17 +0000 (18:52 -0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:18:27 +0000 (02:18 +0000)
commitf7f295391559ca38fb1761ccf5818fd55aea71b7
tree032b2e663654cef3af8c4cfdec50469feddb733a
parentc5331971f5c11c77d08ba5bf4c2c9211fb3f0534
DaVinci-VPFE-Capture: fix error handling

commit d3d83ee20afda16ad0133ba00f63c11a8d842a35 upstream.

A recent cleanup had the right idea to remove the initialization
of the error variable, but missed the actual benefit of that,
which is that we get warnings if there is a bug in it. Now
we get a warning about a bug that was introduced by this cleanup:

drivers/media/platform/davinci/vpfe_capture.c: In function 'vpfe_probe':
drivers/media/platform/davinci/vpfe_capture.c:1992:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This adds the missing initialization that the warning is about,
and another one that was preexisting and that we did not get
a warning for. That second bug has existed since the driver
was first added.

Fixes: efb74461f5a6 ("[media] DaVinci-VPFE-Capture: Delete an unnecessary variable initialisation in vpfe_probe()")
Fixes: 7da8a6cb3e5b ("V4L/DVB (12248): v4l: vpfe capture bridge driver for DM355 and DM6446")

[mchehab@s-opensource.com: fix a merge conflict]
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/media/video/davinci/vpfe_capture.c