aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-19 14:47:07 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-26 06:45:42 -0500
commitdb749359059f3049fc5c66950e5ca85f67d7c1b0 (patch)
tree05192a5286c39166540174b34a0f969a214d0999 /drivers/media/i2c
parent3d263114c4b75d06253f0ed8059164dbc70c9f0c (diff)
[media] cx25840: fix return logic when media entity init fails
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>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/cx25840/cx25840-core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index cb4e03de9b75..185cb55253c9 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -5205,8 +5205,7 @@ static int cx25840_probe(struct i2c_client *client,
5205 state->pads, 0); 5205 state->pads, 0);
5206 if (ret < 0) { 5206 if (ret < 0) {
5207 v4l_info(client, "failed to initialize media entity!\n"); 5207 v4l_info(client, "failed to initialize media entity!\n");
5208 kfree(state); 5208 return ret;
5209 return -ENODEV;
5210 } 5209 }
5211#endif 5210#endif
5212 5211