lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 25 Feb 2015 14:56:46 +0000 From: Lorenzo Pieralisi <lorenzo.pieralisi@....com> To: Daniel Lezcano <daniel.lezcano@...aro.org> Cc: "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Rafael J. Wysocki" <rjw@...ysocki.net> Subject: Re: [PATCH 2/2] drivers: cpuidle: add driver/device checks in cpuidle_enter_freeze() On Wed, Feb 25, 2015 at 02:30:49PM +0000, Daniel Lezcano wrote: [...] > > diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c > > index f47edc6c..344fe6c 100644 > > --- a/drivers/cpuidle/cpuidle.c > > +++ b/drivers/cpuidle/cpuidle.c > > @@ -44,6 +44,12 @@ void disable_cpuidle(void) > > off = 1; > > } > > > > +static bool cpuidle_device_disabled(struct cpuidle_driver *drv, > > + struct cpuidle_device *dev) > > +{ > > + return (off || !initialized || !drv || !dev || !dev->enabled); > > +} > > This is getting a bit fuzzy IMO. What means disabled ? :) > > > /** > > * cpuidle_play_dead - cpu off-lining > > * > > @@ -124,6 +130,11 @@ void cpuidle_enter_freeze(void) > > struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); > > int index; > > I think this is exploding before because of dev == NULL in the line above. Actually not, cpuidle_get_cpu_driver() checks the dev pointer, so we might end up with drv == NULL and dev == NULL, and the check I added still applies and it is effective I think. Lorenzo -- 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