Thermal: Fix wrong condition checking in policy_store
Jinyoung Park [Tue, 1 Jan 2013 02:26:01 +0000 (11:26 +0900)]
Fixed wrong condition checking in policy_store.

Bug 1200111

Change-Id: I8832ae20cc06b0480614599e1850b2a32d2835dc
Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com>
Reviewed-on: http://git-master/r/188033
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Matthew Longnecker <mlongnecker@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

drivers/thermal/thermal_sys.c

index 7cedd86..6d96518 100644 (file)
@@ -707,7 +707,7 @@ policy_store(struct device *dev, struct device_attribute *attr,
 
        mutex_lock(&thermal_governor_lock);
 
-       if ((strlen(buf) >= THERMAL_NAME_LENGTH) && !sscanf(buf, "%s\n", name))
+       if ((strlen(buf) >= THERMAL_NAME_LENGTH) || !sscanf(buf, "%s\n", name))
                goto exit;
 
        gov = __find_governor((const char *)name);