mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
rtc: Fix ioctl error path return
Bryan Henderson noticed that the "RTC: Fix rtc driver ioctl specific shortcutting" commit has a small bug: When an ioctl is called with an invalid command code and the clock driver does not have an "ioctl" method, the ioctl returns rc 0 instead of -ENOTTY. This patch fixes the issue. CC: Bryan Henderson <[email protected]> CC: Gabor Z. Papp <[email protected]> Reported-by: Bryan Henderson <[email protected]> Signed-off-by: John Stultz <[email protected]>
This commit is contained in:
parent
1fa7b6a29c
commit
e17fd4ba2a
1 changed files with 2 additions and 1 deletions
|
|
@ -421,7 +421,8 @@ static long rtc_dev_ioctl(struct file *file,
|
|||
err = ops->ioctl(rtc->dev.parent, cmd, arg);
|
||||
if (err == -ENOIOCTLCMD)
|
||||
err = -ENOTTY;
|
||||
}
|
||||
} else
|
||||
err = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue