grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Re: Revision 2136 breaks two-disk configuarion


From: Pavel Roskin
Subject: Re: [PATCH] Re: Revision 2136 breaks two-disk configuarion
Date: Tue, 28 Apr 2009 09:26:17 -0400

On Tue, 2009-04-28 at 01:59 -0700, David Miller wrote:

> I think it's overkill at the moment.

I've committed the patch with grub_malloc() and the patch making
grub_fs_uuid_close() use grub_device_close().

> > +/* Return partition to be freed if it can be freed.  */
> > +static inline grub_partition_t
> > +grub_partition_unref (const grub_partition_t p)
> > +{
> > +  if (p && p->refcount-- <= 0)
> > +    return p;
> 
> If the reference count dips below zero, that should trigger
> an assertion rather than giving the pointer to the caller
> again which will potentially double-free memory or whatever.

Correct.  If we have a better case for using refcounts, we'll have that
check.

-- 
Regards,
Pavel Roskin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]