cpuquiet: Fix compiler warning
Sai Charan Gurrappadi [Fri, 15 Jun 2012 01:23:17 +0000 (18:23 -0700)]
Change-Id: I03c11c295b40ebd500a715974f7fdca560d9a43a
Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/111286
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

drivers/cpuquiet/sysfs.c

index 1e1c148..0d63eee 100644 (file)
@@ -286,5 +286,6 @@ void cpuquiet_add_dev(struct sys_device *sys_dev, unsigned int cpu)
 
 void cpuquiet_remove_dev(unsigned int cpu)
 {
-       kobject_put(cpuquiet_cpu_devices[cpu]);
+       if (cpu < CONFIG_NR_CPUS && cpuquiet_cpu_devices[cpu])
+               kobject_put(&cpuquiet_cpu_devices[cpu]->kobj);
 }