watchdog: rc32434_wdt: fix ioctl error handling
[pandora-kernel.git] / drivers / watchdog / rc32434_wdt.c
index d4c29b5..56dcae7 100644 (file)
@@ -239,7 +239,7 @@ static long rc32434_wdt_ioctl(struct file *file, unsigned int cmd,
                        return -EINVAL;
                /* Fall through */
        case WDIOC_GETTIMEOUT:
-               return copy_to_user(argp, &timeout, sizeof(int));
+               return copy_to_user(argp, &timeout, sizeof(int)) ? -EFAULT : 0;
        default:
                return -ENOTTY;
        }