Skip to content

Commit

Permalink
[media] m2m-deinterlace: use correct check for kzalloc failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sasha Levin authored and Mauro Carvalho Chehab committed Dec 27, 2012
1 parent c84401c commit 9a3323a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/media/platform/m2m-deinterlace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9a3323a

Please sign in to comment.