linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Johan Hedberg <johan.hedberg@gmail.com>
Cc: "Gustavo F. Padovan" <gustavo@padovan.org>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/3] sbc: Fix redundant null check on calling free()
Date: Tue, 08 Jun 2010 00:13:20 -0700	[thread overview]
Message-ID: <1275981200.2182.38.camel@localhost.localdomain> (raw)
In-Reply-To: <20100608062116.GA16634@jh-x301>

Hi Johan,

> > Issues found by smatch static check: http://smatch.sourceforge.net/
> > ---
> >  sbc/sbc.c    |    3 +--
> >  sbc/sbcdec.c |    9 +++------
> >  2 files changed, 4 insertions(+), 8 deletions(-)
> > 
> > diff --git a/sbc/sbc.c b/sbc/sbc.c
> > index edd152f..86399dd 100644
> > --- a/sbc/sbc.c
> > +++ b/sbc/sbc.c
> > @@ -1138,8 +1138,7 @@ void sbc_finish(sbc_t *sbc)
> >  	if (!sbc)
> >  		return;
> >  
> > -	if (sbc->priv_alloc_base)
> > -		free(sbc->priv_alloc_base);
> > +	free(sbc->priv_alloc_base);
> 
> I'm a bit hesitant at removing these NULL checks since older libc
> versions might need them. Any comments from Marcel?

this is just fine. If you have such an old libc version that doesn't do
it, then you have a problem anyway. I am also not sure that this is a
problem with any libc version at all.

The only argument that might hold this is if you wanna compile this for
a non GNU platform. I don't even know if that is possible since I
actually don't care about non Linux platforms.

Regards

Marcel



      reply	other threads:[~2010-06-08  7:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-05 10:14 Fixes issues reported by Smatch static checker Gustavo F. Padovan
2010-06-05 10:14 ` [PATCH 1/3] sbc: Fix redundant null check on calling free() Gustavo F. Padovan
2010-06-05 10:14   ` [PATCH 2/3] " Gustavo F. Padovan
2010-06-05 10:14     ` [PATCH 3/3] sdptool: Fix 2 possible NULL dereference Gustavo F. Padovan
2010-06-08  6:27       ` Johan Hedberg
2010-06-08  8:02     ` [PATCH 2/3] Fix redundant null check on calling free() Johan Hedberg
2010-06-08  6:21   ` [PATCH 1/3] sbc: " Johan Hedberg
2010-06-08  7:13     ` Marcel Holtmann [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=1275981200.2182.38.camel@localhost.localdomain \
    --to=marcel@holtmann.org \
    --cc=gustavo@padovan.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@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;
as well as URLs for NNTP newsgroup(s).