[stgt] [PATCH 2/3] few logger fixes

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Fri Jun 4 02:01:26 CEST 2010


On Fri, 4 Jun 2010 00:31:07 +0300
"Alexander Nezhinsky" <alexandern at voltaire.com> wrote:

> -----Original Message-----
> From: FUJITA Tomonori [mailto:fujita.tomonori at lab.ntt.co.jp]
> Sent: Thu 6/3/2010 5:23 PM
>  
> On Thu, 03 Jun 2010 16:23:10 +0300
> Alexander Nezhinsky <alexandern at Voltaire.COM> wrote:
> 
> > added initialization and safety checks for the logarea pointer
> > 
> > -static struct logarea *la;
> > +static struct logarea *la = NULL;
> 
> > Hmm, guaranteed to be initialized.
> 
> >  static void free_logarea (void)
> >  {
> > +	if (!la)
> > +		return;
> >  	semctl(la->semid, 0, IPC_RMID, la->semarg);
> >  	shmdt(la->buff);
> >  	shmdt(la->start);
> >  	shmdt(la);
> > +	la = NULL;
> >  }
> 
> Ok, sure. Initialization added mainly for expressiveness.
> My point was mainly in adding checks and resetting to NULL upon free.

ok, please send the updated patch (drop the excessive
initialization). I think that resetting to NULL is also excessive too
though.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list