video: adf: validate dpms state passed to blank
authorGreg Hackmann <ghackmann@google.com>
Wed, 20 Nov 2013 20:10:35 +0000 (12:10 -0800)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:53:16 +0000 (13:53 -0800)
Change-Id: I3a4228d50fc4a2553b3e92e5675a94cbc6e71b8a
Signed-off-by: Greg Hackmann <ghackmann@google.com>
drivers/video/adf/adf_client.c

index e4a792135072a53d676d7b9b4549eb8f0e7db253..bba873d34bbb3dd2c8b055e8c84f207893a42304 100644 (file)
@@ -49,6 +49,9 @@ int adf_interface_blank(struct adf_interface *intf, u8 state)
        if (!intf->ops || !intf->ops->blank)
                return -EOPNOTSUPP;
 
+       if (state > DRM_MODE_DPMS_OFF)
+               return -EINVAL;
+
        mutex_lock(&dev->client_lock);
        if (state != DRM_MODE_DPMS_ON)
                flush_kthread_worker(&dev->post_worker);