From: Sasha Levin Date: Thu, 20 Dec 2012 18:11:18 +0000 (-0300) Subject: [media] m2m-deinterlace: use correct check for kzalloc failure X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9a3323aef4e32585a76ace5f53973404e7e5afee;p=openwrt%2Fstaging%2Fblogic.git [media] m2m-deinterlace: use correct check for kzalloc failure There is no point in PTR_ERR()ing a NULL pointer, use a real error instead. Signed-off-by: Sasha Levin Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c index ed77a645e992..6c4db9b98989 100644 --- a/drivers/media/platform/m2m-deinterlace.c +++ b/drivers/media/platform/m2m-deinterlace.c @@ -917,10 +917,8 @@ static int deinterlace_open(struct file *file) ctx->xt = kzalloc(sizeof(struct dma_async_tx_descriptor) + sizeof(struct data_chunk), GFP_KERNEL); if (!ctx->xt) { - int ret = PTR_ERR(ctx->xt); - kfree(ctx); - return ret; + return -ENOMEM; } ctx->colorspace = V4L2_COLORSPACE_REC709;