From: Jingoo Han <jg1.han@samsung.com>
To: 'Dan Carpenter' <dan.carpenter@oracle.com>,
'Mauro Carvalho Chehab' <m.chehab@samsung.com>
Cc: "'Greg Kroah-Hartman'" <gregkh@linuxfoundation.org>,
"'Hans Verkuil'" <hans.verkuil@cisco.com>,
"'Jon Mason'" <jdmason@kudzu.us>,
"'Russell King'" <rmk+kernel@arm.linux.org.uk>,
"'Sakari Ailus'" <sakari.ailus@iki.fi>,
"'Kristina Martšenko'" <kristina.martsenko@gmail.com>,
linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
kernel-janitors@vger.kernel.org,
"'Jingoo Han'" <jg1.han@samsung.com>
Subject: Re: [patch] [media] Staging: dt3155v4l: set error code on failure
Date: Mon, 12 May 2014 02:39:12 +0000 [thread overview]
Message-ID: <000a01cf6d8b$5c0ef6c0$142ce440$%han@samsung.com> (raw)
In-Reply-To: <20140509115509.GA32027@mwanda>
On Friday, May 09, 2014 8:55 PM, Dan Carpenter wrote:
>
> We should be returning -ENOMEM here instead of success.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
It looks good. video_device_alloc() calls kzalloc(); thus,
when video_device_alloc() returns NULL, '-ENOMEM' should be
returned.
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Best regards,
Jingoo Han
>
> diff --git a/drivers/staging/media/dt3155v4l/dt3155v4l.c b/drivers/staging/media/dt3155v4l/dt3155v4l.c
> index afbc2e5..178aa5b 100644
> --- a/drivers/staging/media/dt3155v4l/dt3155v4l.c
> +++ b/drivers/staging/media/dt3155v4l/dt3155v4l.c
> @@ -907,8 +907,10 @@ dt3155_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> if (!pd)
> return -ENOMEM;
> pd->vdev = video_device_alloc();
> - if (!pd->vdev)
> + if (!pd->vdev) {
> + err = -ENOMEM;
> goto err_video_device_alloc;
> + }
> *pd->vdev = dt3155_vdev;
> pci_set_drvdata(pdev, pd); /* for use in dt3155_remove() */
> video_set_drvdata(pd->vdev, pd); /* for use in video_fops */
prev parent reply other threads:[~2014-05-12 2:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 11:55 [patch] [media] Staging: dt3155v4l: set error code on failure Dan Carpenter
2014-05-12 2:39 ` Jingoo Han [this message]
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='000a01cf6d8b$5c0ef6c0$142ce440$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hans.verkuil@cisco.com \
--cc=jdmason@kudzu.us \
--cc=kernel-janitors@vger.kernel.org \
--cc=kristina.martsenko@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=sakari.ailus@iki.fi \
/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