All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matti J. Aaltonen" <matti.j.aaltonen@nokia.com>
To: ext Alexey Klimov <klimov.linux@gmail.com>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"hverkuil@xs4all.nl" <hverkuil@xs4all.nl>,
	"Valentin Eduardo (Nokia-MS/Helsinki)"
	<eduardo.valentin@nokia.com>,
	"mchehab@redhat.com" <mchehab@redhat.com>
Subject: Re: [PATCH v7 4/5] V4L2: WL1273 FM Radio: Controls for the FM radio.
Date: Thu, 12 Aug 2010 13:45:17 +0300	[thread overview]
Message-ID: <1281609917.14489.73.camel@masi.mnp.nokia.com> (raw)
In-Reply-To: <AANLkTin_55zYQoJ3zzMtiJtSS7bnPv4CB6hjggeez23a@mail.gmail.com>

Hello Alexey

On Wed, 2010-08-11 at 10:06 +0200, ext Alexey Klimov wrote: 
> > +
> > +       radio = kzalloc(sizeof(*radio), GFP_KERNEL);
> > +       if (!radio)
> > +               return -ENOMEM;
> > +
> > +       radio->write_buf = kmalloc(256, GFP_KERNEL);
> > +       if (!radio->write_buf)
> > +               return -ENOMEM;
> 
> I'm not sure but it looks like possible memory leak. Shouldn't you
> call to kfree(radio) before returning ENOMEM?

Yes you're right...

> et_drvdata(&radio->videodev, radio);
> > +       platform_set_drvdata(pdev, radio);
> > +
> > +       return 0;
> > +
> > +err_video_register:
> > +       v4l2_device_unregister(&radio->v4l2dev);
> > +err_device_alloc:
> > +       kfree(radio);
> 
> And i'm not sure about this error path.. Before kfree(radio) it's
> needed to call kfree(radio->write_buf), rigth?
> Looks like all erorr paths in this probe function have to be checked.

Yes, I'll the the error handling here...

Thanks,
Matti 
> --
> Best regards, Klimov 




  parent reply	other threads:[~2010-08-12 10:45 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02 14:06 [PATCH v7 0/5] TI WL1273 FM Radio driver Matti J. Aaltonen
2010-08-02 14:06 ` [PATCH v7 1/5] V4L2: Add seek spacing and FM RX class Matti J. Aaltonen
2010-08-02 14:06   ` [PATCH v7 2/5] MFD: WL1273 FM Radio: MFD driver for the FM radio Matti J. Aaltonen
2010-08-02 14:06     ` [PATCH v7 3/5] ASoC: WL1273 FM Radio Digital audio codec Matti J. Aaltonen
2010-08-02 14:06       ` [PATCH v7 4/5] V4L2: WL1273 FM Radio: Controls for the FM radio Matti J. Aaltonen
2010-08-02 14:06         ` [PATCH v7 5/5] Documentation: v4l: Add hw_seek spacing and FM_RX class Matti J. Aaltonen
2010-08-09 16:34         ` [PATCH v7 4/5] V4L2: WL1273 FM Radio: Controls for the FM radio Hans Verkuil
2010-08-11  8:06         ` Alexey Klimov
2010-08-11  9:27           ` Matti J. Aaltonen
2010-08-12 10:45           ` Matti J. Aaltonen [this message]
2010-08-12 12:10         ` pramodh ag
2010-08-12 12:28           ` Matti J. Aaltonen
2010-08-20 12:04         ` pramodh ag
2010-08-23  6:53           ` Matti J. Aaltonen
2010-08-28  9:43             ` Hans Verkuil
2010-08-09 16:38   ` [PATCH v7 1/5] V4L2: Add seek spacing and FM RX class Hans Verkuil
2010-08-10  7:31     ` Matti J. Aaltonen
2010-08-10  8:04       ` Hans Verkuil
2010-08-10 10:18         ` Matti J. Aaltonen
2010-08-10 12:03         ` Matti J. Aaltonen
2010-08-10 12:14           ` Mauro Carvalho Chehab
2010-08-10 12:30             ` Matti J. Aaltonen
2010-08-11  9:21             ` A problem with http://git.linuxtv.org/media_tree.git Matti J. Aaltonen
2010-08-11 10:56               ` Hans Verkuil
2010-08-11 11:34                 ` Matti J. Aaltonen
2010-08-11 11:44                   ` Matti J. Aaltonen
2010-08-11 12:13                     ` Hans Verkuil
2010-08-11 13:16                     ` Mauro Carvalho Chehab
2010-08-12  9:45                       ` Matti J. Aaltonen
2010-08-12 10:29                         ` Hans Verkuil
2010-08-12 10:34                           ` Matti J. Aaltonen
2010-08-11 12:49                 ` Mauro Carvalho Chehab
2010-08-09  7:33 ` [PATCH v7 0/5] TI WL1273 FM Radio driver Matti J. Aaltonen
2010-08-09  8:05   ` Hans Verkuil

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=1281609917.14489.73.camel@masi.mnp.nokia.com \
    --to=matti.j.aaltonen@nokia.com \
    --cc=eduardo.valentin@nokia.com \
    --cc=hverkuil@xs4all.nl \
    --cc=klimov.linux@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.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.