Message ID | 2514ec03df9c33b86e56748513267a80dd8004d9.1558117389.git.jaharkes@cs.cmu.edu (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Coda updates | expand |
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index f2bb7985d21c..12cec325384c 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c @@ -186,8 +186,11 @@ static ssize_t coda_psdev_write(struct file *file, const char __user *buf, if (req->uc_opcode == CODA_OPEN_BY_FD) { struct coda_open_by_fd_out *outp = (struct coda_open_by_fd_out *)req->uc_data; - if (!outp->oh.result) + if (!outp->oh.result) { outp->fh = fget(outp->fd); + if (!outp->fh) + return -EBADF; + } } wake_up(&req->uc_sleep);