public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	devel@driverdev.osuosl.org, fmhess@users.sourceforge.net,
	abbotti@mev.co.uk, gregkh@linuxfoundation.org
Subject: Re: [PATCH 17/31] staging: comedi: ni_daq_700: remove unused private data variable
Date: Mon, 25 Jun 2012 10:31:15 +0300	[thread overview]
Message-ID: <20120625073115.GI5333@mwanda> (raw)
In-Reply-To: <201206221626.47010.hartleys@visionengravers.com>

On Fri, Jun 22, 2012 at 04:26:46PM -0700, H Hartley Sweeten wrote:
> The 'have_irq' variable is not needed since this driver doesn't
> use interrupts. Remove it.
> 
> The kfree(s->private) needs to remain to free the memory allocated
> in subdev_700_init().
> 

Hm...  That's weird.  The function which set have_irq to 1 was never
called and you already removed it in a previous patch.

So this fixes a memory leak right?  Because the kfree() was never
called in the original code.  Please mark bug fixes as special if
you can.

>  #define CALLBACK_ARG	(((struct subdev_700_struct *)s->private)->cb_arg)
> @@ -166,9 +165,7 @@ static void subdev_700_cleanup(struct comedi_device *dev,
>  			       struct comedi_subdevice *s)
>  {
>  	if (s->private)
> -		if (subdevpriv->have_irq)
> -
> -			kfree(s->private);
> +		kfree(s->private);

You could also remove the: "if (s->private)" check.

regards,
dan carpenter



      reply	other threads:[~2012-06-25  7:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22 23:26 [PATCH 17/31] staging: comedi: ni_daq_700: remove unused private data variable H Hartley Sweeten
2012-06-25  7:31 ` Dan Carpenter [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=20120625073115.GI5333@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=fmhess@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hartleys@visionengravers.com \
    --cc=linux-kernel@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