diff options
author | Dae S. Kim <dae@velatum.com> | 2012-08-31 02:00:51 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-02 10:29:52 -0700 |
commit | 6252fbdc0a40c20a21b24d7bfccf3c08ea9b10dc (patch) | |
tree | 8034a8d9764257a0ee232f5f59170f5f7a4830ea | |
parent | 8cc876def310b034ab0e0775a14d1a49472d7f5f (diff) | |
download | linux-3.10-6252fbdc0a40c20a21b24d7bfccf3c08ea9b10dc.tar.gz linux-3.10-6252fbdc0a40c20a21b24d7bfccf3c08ea9b10dc.tar.bz2 linux-3.10-6252fbdc0a40c20a21b24d7bfccf3c08ea9b10dc.zip |
Staging: Android alarm: IOCTL command encoding fix
commit 6bd4a5d96c08dc2380f8053b1bd4f879f55cd3c9 upstream.
Fixed a bug. Data was being written to user space using an IOCTL
command encoded with _IOC_WRITE access mode.
Signed-off-by: Dae S. Kim <dae@velatum.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/android/android_alarm.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/android/android_alarm.h b/drivers/staging/android/android_alarm.h index 6eecbde2ef6..66b6e3decc6 100644 --- a/drivers/staging/android/android_alarm.h +++ b/drivers/staging/android/android_alarm.h @@ -110,10 +110,12 @@ enum android_alarm_return_flags { #define ANDROID_ALARM_WAIT _IO('a', 1) #define ALARM_IOW(c, type, size) _IOW('a', (c) | ((type) << 4), size) +#define ALARM_IOR(c, type, size) _IOR('a', (c) | ((type) << 4), size) + /* Set alarm */ #define ANDROID_ALARM_SET(type) ALARM_IOW(2, type, struct timespec) #define ANDROID_ALARM_SET_AND_WAIT(type) ALARM_IOW(3, type, struct timespec) -#define ANDROID_ALARM_GET_TIME(type) ALARM_IOW(4, type, struct timespec) +#define ANDROID_ALARM_GET_TIME(type) ALARM_IOR(4, type, struct timespec) #define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec) #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0))) #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4) |