diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2016-02-15 09:35:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-05 15:19:39 -0500 |
commit | ecb63a1b644c77a383b05e44e931602ae5f3d2c6 (patch) | |
tree | 98912adbede6387524518726c6db1855a1fedf70 /drivers/char | |
parent | ba327173ef48c12cf6f326441c74f373fa3be220 (diff) |
drivers: char: mem: fix IS_ERROR_VALUE usage
IS_ERR_VALUE macro should be used only with unsigned long type.
Specifically it works incorrectly with longer types.
The patch follows conclusion from discussion on LKML [1][2].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2120927
[2]: http://permalink.gmane.org/gmane.linux.kernel/2150581
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 4f6f94c43412..71025c2f6bbb 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -695,7 +695,7 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig) | |||
695 | offset += file->f_pos; | 695 | offset += file->f_pos; |
696 | case SEEK_SET: | 696 | case SEEK_SET: |
697 | /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ | 697 | /* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */ |
698 | if (IS_ERR_VALUE((unsigned long long)offset)) { | 698 | if ((unsigned long long)offset >= -MAX_ERRNO) { |
699 | ret = -EOVERFLOW; | 699 | ret = -EOVERFLOW; |
700 | break; | 700 | break; |
701 | } | 701 | } |