From: Hans de Goede <hdegoede@redhat.com>
To: Hans Verkuil <hansverk@cisco.com>, Ethan Zhao <ethan.kernel@gmail.com>
Cc: hans.verkuil@cisco.com, m.chehab@samsung.com,
gregkh@linuxfoundation.org,
linux-media <linux-media@vger.kernel.org>
Subject: Re: [PATCH] media: gspaca: check pointer against NULL before using it in create_urbs()
Date: Fri, 10 Jan 2014 16:01:37 +0100 [thread overview]
Message-ID: <52D00B51.7090009@redhat.com> (raw)
In-Reply-To: <52CFF094.5080408@cisco.com>
Hi,
Thanks for the patch, but the return value is already checked earlier on when
building the ep_tb table, so it can never return NULL here.
Regards,
Hans
On 01/10/2014 02:07 PM, Hans Verkuil wrote:
> Cc to linux-media and Hans de Goede (gspca maintainer).
>
> Regards,
>
> Hans
>
> On 01/07/14 10:56, Ethan Zhao wrote:
>> function alt_xfer() may return NULL, should check its return value passed into
>> create_urbs() as parameter.
>>
>> gspca_init_transfer()
>> {
>> ... ...
>> ret = create_urbs(gspca_dev,alt_xfer(&intf->altsetting[alt], xfer));
>> ... ...
>> }
>>
>> Signed-off-by: Ethan Zhao <ethan.kernel@gmail.com>
>> ---
>> drivers/media/usb/gspca/gspca.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
>> index 048507b..eb45bc0 100644
>> --- a/drivers/media/usb/gspca/gspca.c
>> +++ b/drivers/media/usb/gspca/gspca.c
>> @@ -761,6 +761,8 @@ static int create_urbs(struct gspca_dev *gspca_dev,
>> struct urb *urb;
>> int n, nurbs, i, psize, npkt, bsize;
>>
>> + if (!ep)
>> + return -EINVAL;
>> /* calculate the packet size and the number of packets */
>> psize = le16_to_cpu(ep->desc.wMaxPacketSize);
>>
>>
prev parent reply other threads:[~2014-01-10 15:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-07 9:56 [PATCH] media: gspaca: check pointer against NULL before using it in create_urbs() Ethan Zhao
2014-01-10 13:07 ` Hans Verkuil
2014-01-10 15:01 ` Hans de Goede [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=52D00B51.7090009@redhat.com \
--to=hdegoede@redhat.com \
--cc=ethan.kernel@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hans.verkuil@cisco.com \
--cc=hansverk@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.