On Sun, 2 Aug 2009 17:25:29 +0400
Alexey Klimov <[email protected]> wrote:
> > + buffer = kmalloc(JEILINJ_MAX_TRANSFER, GFP_KERNEL |
> > GFP_DMA);
> > + if (!buffer) {
> > + PDEBUG(D_ERR, "Couldn't allocate USB buffer");
> > + goto quit_stream;
> > + }
>
> This clean up on error path looks bad. On quit_stream you have:
>
> > +quit_stream:
> > + mutex_lock(&gspca_dev->usb_lock);
> > + if (gspca_dev->present)
> > + jlj_stop(gspca_dev);
> > + mutex_unlock(&gspca_dev->usb_lock);
> > + kfree(buffer);
>
> kfree() tries to free null buffer after kmalloc for buffer failed.
> Please, check if i'm not wrong.
Hi Alexey,
AFAIK, kfree() checks the pointer.
Cheers.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html