media: v4l: async: fix return of unitialized variable ret
authorColin Ian King <colin.king@canonical.com>
Fri, 3 Nov 2017 06:58:27 +0000 (02:58 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 7 Nov 2017 08:06:24 +0000 (03:06 -0500)
commit580db6ca62c168733c6fd338cd2f0ebf39135283
tree94dc513fde6891ccb80eee632a0e3bda14e46ea8
parent2b00e30fc33de720cedad69427931aa393cdbaf0
media: v4l: async: fix return of unitialized variable ret

A shadow declaration of variable ret is being assigned a return error
status and this value is being lost when the error exit goto's jump
out of the local scope. This leads to an uninitalized error return value
in the outer scope being returned. Fix this by removing the inner scoped
declaration of variable ret.

Detected by CoverityScan, CID#1460380 ("Uninitialized scalar variable")

Fixes: fb45f436b818 ("media: v4l: async: Fix notifier complete callback error handling")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/v4l2-async.c