diff options
Diffstat (limited to 'arch/parisc/hpux/fs.c')
-rw-r--r-- | arch/parisc/hpux/fs.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index d7c80edf4489..6e79dbf3f6bd 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c | |||
@@ -77,17 +77,21 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, | |||
77 | { | 77 | { |
78 | struct hpux_dirent * dirent; | 78 | struct hpux_dirent * dirent; |
79 | struct getdents_callback * buf = (struct getdents_callback *) __buf; | 79 | struct getdents_callback * buf = (struct getdents_callback *) __buf; |
80 | ino_t d_ino; | ||
80 | int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); | 81 | int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1); |
81 | 82 | ||
82 | buf->error = -EINVAL; /* only used if we fail.. */ | 83 | buf->error = -EINVAL; /* only used if we fail.. */ |
83 | if (reclen > buf->count) | 84 | if (reclen > buf->count) |
84 | return -EINVAL; | 85 | return -EINVAL; |
86 | d_ino = ino; | ||
87 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) | ||
88 | return -EOVERFLOW; | ||
85 | dirent = buf->previous; | 89 | dirent = buf->previous; |
86 | if (dirent) | 90 | if (dirent) |
87 | put_user(offset, &dirent->d_off); | 91 | put_user(offset, &dirent->d_off); |
88 | dirent = buf->current_dir; | 92 | dirent = buf->current_dir; |
89 | buf->previous = dirent; | 93 | buf->previous = dirent; |
90 | put_user(ino, &dirent->d_ino); | 94 | put_user(d_ino, &dirent->d_ino); |
91 | put_user(reclen, &dirent->d_reclen); | 95 | put_user(reclen, &dirent->d_reclen); |
92 | put_user(namlen, &dirent->d_namlen); | 96 | put_user(namlen, &dirent->d_namlen); |
93 | copy_to_user(dirent->d_name, name, namlen); | 97 | copy_to_user(dirent->d_name, name, namlen); |