[Cbe-oss-dev] [PATCH] cell: cbe_cpufreq cleanup and crash fix

Olof Johansson olof at lixom.net
Fri Apr 27 15:32:20 EST 2007


On Fri, Apr 27, 2007 at 02:22:06PM +0900, Akinobu Mita wrote:
> On Thu, Apr 26, 2007 at 06:07:54PM -0500, Olof Johansson wrote:
> > @@ -303,6 +303,9 @@ static int __init cbe_cpufreq_init(void)
> >  {
> >  	struct device_node *np;
> >  
> > +	if (!machine_is(cell))
> > +		return 0;
> > +
> 
> Please return -ENODEV to prevent loading module.
> 
> Otherwise it will cause crash when unloading the module
> because of cpufreq_unregister_driver() with unregistered driver.

It won't crash due to the checks in cpufreq_unregister_driver(), but
it's still better to return failure.


Thanks,

-Olof



More information about the cbe-oss-dev mailing list