]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ideapad: Only allow camera state to be set to 0 or 1
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 11 Aug 2010 16:59:51 +0000 (17:59 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 11 Aug 2010 17:00:52 +0000 (18:00 +0100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/platform/x86/ideapad_acpi.c

index 8a89902e5d55a52c4e39375f6c08acdbe5a0a04a..798496353e8c6aa824a4582355dfbbe36424d9aa 100644 (file)
@@ -140,7 +140,7 @@ static ssize_t store_ideapad_cam(struct device *dev,
                return 0;
        if (sscanf(buf, "%i", &state) != 1)
                return -EINVAL;
-       ret = ideapad_dev_set_state(IDEAPAD_DEV_CAMERA, state);
+       ret = ideapad_dev_set_state(IDEAPAD_DEV_CAMERA, !!state);
        if (ret < 0)
                return ret;
        return count;