From: Sasha Levin <sasha.levin@oracle.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>,
Sylwester Nawrocki <sylvester.nawrocki@gmail.com>,
Javier Martin <javier.martin@vista-silicon.com>,
Sasha Levin <sasha.levin@oracle.com>,
Sakari Ailus <sakari.ailus@iki.fi>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] m2m-deinterlace: use correct check for kzalloc failure
Date: Thu, 20 Dec 2012 14:11:18 -0500 [thread overview]
Message-ID: <1356030701-16284-10-git-send-email-sasha.levin@oracle.com> (raw)
In-Reply-To: <1356030701-16284-1-git-send-email-sasha.levin@oracle.com>
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>
---
drivers/media/platform/m2m-deinterlace.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c
index 05c560f..64db74e 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;
--
1.8.0
parent reply other threads:[~2012-12-20 19:13 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1356030701-16284-1-git-send-email-sasha.levin@oracle.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1356030701-16284-10-git-send-email-sasha.levin@oracle.com \
--to=sasha.levin@oracle.com \
--cc=javier.martin@vista-silicon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=sakari.ailus@iki.fi \
--cc=sylvester.nawrocki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).