All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] cx25840: fix return logic when media entity init fails
@ 2015-02-19 19:53 Mauro Carvalho Chehab
  0 siblings, 0 replies; only message in thread
From: Mauro Carvalho Chehab @ 2015-02-19 19:53 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab

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 | 3 +--
 1 file changed, 1 insertion(+), 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,
 				state->pads, 0);
 	if (ret < 0) {
 		v4l_info(client, "failed to initialize media entity!\n");
-		kfree(state);
-		return -ENODEV;
+		return ret;
 	}
 #endif
 
-- 
2.1.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-19 19:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-19 19:53 [PATCH] [media] cx25840: fix return logic when media entity init fails Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.