Skip to content

Commit

Permalink
rtc: Fix ioctl error path return
Browse files Browse the repository at this point in the history
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 <bryanh@giraffe-data.com>
CC: Gabor Z. Papp <gzp@papp.hu>
Reported-by: Bryan Henderson <bryanh@giraffe-data.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
  • Loading branch information
John Stultz committed Jun 2, 2011
1 parent 1fa7b6a commit e17fd4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/rtc/rtc-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e17fd4b

Please sign in to comment.