Re: [PATCH] media: gspaca: check pointer against NULL before using it in create_urbs()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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);
>  
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux