فهرست منبع

[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>
Mauro Carvalho Chehab 10 سال پیش
والد
کامیت
db74935905
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      drivers/media/i2c/cx25840/cx25840-core.c

+ 1 - 2
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