[media] m2m-deinterlace: use correct check for kzalloc failure
authorSasha Levin <sasha.levin@oracle.com>
Thu, 20 Dec 2012 18:11:18 +0000 (15:11 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 27 Dec 2012 21:08:12 +0000 (19:08 -0200)
There is no point in PTR_ERR()ing a NULL pointer, use a real error
instead.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/m2m-deinterlace.c

index ed77a645e99266408143862f973eb6e277156276..6c4db9b989899bff0314dc0f031a219ab8f7180d 100644 (file)
@@ -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;