[tip:timers/urgent] rtc: Fix ioctl error path return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  e17fd4ba2a81f1d29875b20464e4899185a3c946
Gitweb:     http://git.kernel.org/tip/e17fd4ba2a81f1d29875b20464e4899185a3c946
Author:     John Stultz <john.stultz@xxxxxxxxxx>
AuthorDate: Tue, 31 May 2011 23:26:11 -0700
Committer:  John Stultz <john.stultz@xxxxxxxxxx>
CommitDate: Wed, 1 Jun 2011 19:29:39 -0700

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 <bryanh@xxxxxxxxxxxxxxxx>
CC: Gabor Z. Papp <gzp@xxxxxxx>
Reported-by: Bryan Henderson <bryanh@xxxxxxxxxxxxxxxx>
Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
---
 drivers/rtc/rtc-dev.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index d0e06ed..cace6d3 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -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;
 	}
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux