From: Jean-Francois Moine <moinejf@free.fr>
To: Alexey Klimov <klimov.linux@gmail.com>
Cc: Theodore Kilgore <kilgota@banach.math.auburn.edu>,
Andy Walls <awalls@radix.net>,
Linux Media <linux-media@vger.kernel.org>
Subject: Re: [PATCH] to add support for certain Jeilin dual-mode cameras.
Date: Mon, 3 Aug 2009 08:30:12 +0200 [thread overview]
Message-ID: <20090803083012.44da22ca@tele> (raw)
In-Reply-To: <208cbae30908020625x400f6b3era5095c8bfc5c736b@mail.gmail.com>
On Sun, 2 Aug 2009 17:25:29 +0400
Alexey Klimov <klimov.linux@gmail.com> 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/
next prev parent reply other threads:[~2009-08-03 6:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090418183124.1c9160e3@free.fr>
2009-08-01 21:56 ` [PATCH] to add support for certain Jeilin dual-mode cameras Theodore Kilgore
2009-08-02 8:33 ` Jean-Francois Moine
2009-08-02 19:12 ` Theodore Kilgore
2009-08-03 8:39 ` Jean-Francois Moine
2009-08-03 16:01 ` Theodore Kilgore
2009-08-03 17:26 ` Mauro Carvalho Chehab
2009-08-03 19:46 ` Theodore Kilgore
2009-08-03 21:59 ` Mauro Carvalho Chehab
2009-08-04 5:45 ` Theodore Kilgore
2009-08-02 20:37 ` [PATCH] to add support for certain Jeilin dual-mode cameras. (resubmit) Theodore Kilgore
2009-08-02 13:25 ` [PATCH] to add support for certain Jeilin dual-mode cameras Alexey Klimov
2009-08-03 6:30 ` Jean-Francois Moine [this message]
2009-08-03 12:11 ` Mauro Carvalho Chehab
2009-08-04 6:51 ` Alexey Klimov
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=20090803083012.44da22ca@tele \
--to=moinejf@free.fr \
--cc=awalls@radix.net \
--cc=kilgota@banach.math.auburn.edu \
--cc=klimov.linux@gmail.com \
--cc=linux-media@vger.kernel.org \
/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