From: Philipp Zabel Date: Tue, 21 May 2013 13:31:25 +0000 (-0300) Subject: [media] coda: fix error return value if v4l2_m2m_ctx_init fails X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=72720ffc74a58ce27ea237c729f38e6a966f2997;p=linux-beck.git [media] coda: fix error return value if v4l2_m2m_ctx_init fails Use ret from the outer scope, instead of redefining it in the conditional clause. That way the error value reaches the end of the function as intended. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/coda.c b/drivers/media/platform/coda.c index b1f77d3c8594..aebd17251ba2 100644 --- a/drivers/media/platform/coda.c +++ b/drivers/media/platform/coda.c @@ -1484,7 +1484,7 @@ static int coda_open(struct file *file) ctx->m2m_ctx = v4l2_m2m_ctx_init(dev->m2m_dev, ctx, &coda_queue_init); if (IS_ERR(ctx->m2m_ctx)) { - int ret = PTR_ERR(ctx->m2m_ctx); + ret = PTR_ERR(ctx->m2m_ctx); v4l2_err(&dev->v4l2_dev, "%s return error (%d)\n", __func__, ret);