diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/coda/psdev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 0ceef32e6fae..241f7e04ad04 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
@@ -182,8 +182,11 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, | |||
182 | if (req->uc_opcode == CODA_OPEN_BY_FD) { | 182 | if (req->uc_opcode == CODA_OPEN_BY_FD) { |
183 | struct coda_open_by_fd_out *outp = | 183 | struct coda_open_by_fd_out *outp = |
184 | (struct coda_open_by_fd_out *)req->uc_data; | 184 | (struct coda_open_by_fd_out *)req->uc_data; |
185 | if (!outp->oh.result) | 185 | if (!outp->oh.result) { |
186 | outp->fh = fget(outp->fd); | 186 | outp->fh = fget(outp->fd); |
187 | if (!outp->fh) | ||
188 | return -EBADF; | ||
189 | } | ||
187 | } | 190 | } |
188 | 191 | ||
189 | wake_up(&req->uc_sleep); | 192 | wake_up(&req->uc_sleep); |