Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b9468d4 authored by Wim Van Sebroeck's avatar Wim Van Sebroeck
Browse files

watchdog: core: fix WDIOC_GETSTATUS return value



In commit 7a879824 we added
a wrapper for the WDIOC_GETSTATUS ioctl call. The code results
however in a different behaviour: it returns an error if the
driver doesn't support the status operation. This is not
according to the API that says that when we don't support
the status operation, that we just should return a 0 value.
Only when the device isn't there anymore, we should return an
error.

Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent a089361c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -349,7 +349,7 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd,
			sizeof(struct watchdog_info)) ? -EFAULT : 0;
			sizeof(struct watchdog_info)) ? -EFAULT : 0;
	case WDIOC_GETSTATUS:
	case WDIOC_GETSTATUS:
		err = watchdog_get_status(wdd, &val);
		err = watchdog_get_status(wdd, &val);
		if (err)
		if (err == -ENODEV)
			return err;
			return err;
		return put_user(val, p);
		return put_user(val, p);
	case WDIOC_GETBOOTSTATUS:
	case WDIOC_GETBOOTSTATUS: