[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110323121458.ec7cdaf9.sfr@canb.auug.org.au>
Date: Wed, 23 Mar 2011 12:14:58 +1100
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Trinabh Gupta <trinabh@...ux.vnet.ibm.com>
Cc: arjan@...ux.intel.com, peterz@...radead.org, lenb@...nel.org,
suresh.b.siddha@...el.com, benh@...nel.crashing.org,
venki@...gle.com, ak@...ux.intel.com, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH V4 5/5] cpuidle: cpuidle driver for apm
Hi,
On Tue, 22 Mar 2011 18:03:40 +0530 Trinabh Gupta <trinabh@...ux.vnet.ibm.com> wrote:
>
> +static int apm_setup_cpuidle(int cpu)
> +{
> + struct cpuidle_device *dev = kzalloc(sizeof(struct cpuidle_device),
> + GFP_KERNEL);
Same as xen comments: no NULL check.
> + int count = CPUIDLE_DRIVER_STATE_START;
> + dev->cpu = cpu;
> + dev->drv = &apm_idle_driver;
Also wondering why you would ever have a different idle routine on
different cpus?
> +
> + dev->states[count] = state_apm_idle;
> + count++;
> +
> + dev->state_count = count;
> +
> + if (cpuidle_register_device(dev))
> + return -EIO;
And we leak dev.
> +static void apm_idle_exit(void)
> +{
> + cpuidle_unregister_driver(&apm_idle_driver);
Do we leak the per cpu device structure here?
> + return;
Unnecessary return statement.
--
Cheers,
Stephen Rothwell sfr@...b.auug.org.au
http://www.canb.auug.org.au/~sfr/
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists