[media] cx25840: fix return logic when media entity init fails
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 19 Feb 2015 19:47:07 +0000 (16:47 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 26 Feb 2015 11:45:42 +0000 (08:45 -0300)
There's no need to free state, as it was allocated via devm_kzalloc().

Also, let's return the error code, instead of something else.

Reported-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/i2c/cx25840/cx25840-core.c

index cb4e03de9b751df67d3b50f928398fc07e268a29..185cb55253c96b3b21342f66d636541c4ec1e7ee 100644 (file)
@@ -5205,8 +5205,7 @@ static int cx25840_probe(struct i2c_client *client,
                                state->pads, 0);
        if (ret < 0) {
                v4l_info(client, "failed to initialize media entity!\n");
-               kfree(state);
-               return -ENODEV;
+               return ret;
        }
 #endif
 
This page took 0.028144 seconds and 5 git commands to generate.