[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130506120925.GA25542@amd.pavel.ucw.cz>
Date: Mon, 6 May 2013 14:09:25 +0200
From: Pavel Machek <pavel@....cz>
To: "Rafael J. Wysocki" <rjw@...k.pl>
Cc: Shuah Khan <shuah.kh@...sung.com>,
"len.brown@...el.com" <len.brown@...el.com>,
"rafael.j.wysocki@...el.com" <rafael.j.wysocki@...el.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"shuahkhan@...il.com" <shuahkhan@...il.com>
Subject: Re: [PATCH] PM: Fix dev_pm_put_subsys_data() to not call kfree()
while holding device power lock
Hi!
> > Wow, that function is fragile. It returns 0/1/-EINVAL, while being
> > documented for 0/1...
>
> Oh, it generally should return 1 for !psd.
>
> > Patch does not look obviously wrong, but maybe
> >
> > @@ -73,13 +73,17 @@ int dev_pm_put_subsys_data(struct device *dev)
> >
> > if (--psd->refcount == 0) {
> > dev->power.subsys_data = NULL;
> > + spin_unlock_irq(&dev->power.lock);
> > - kfree(psd);
> > - ret = 1;
> > + return 1;
> > }
> >
> > Would be cleaner.
>
> What about this:
Looks good to me.
Reviewed-by: Pavel Machek <pavel@....cz>
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists