summaryrefslogtreecommitdiffstats
path: root/sys/ofed/include/linux
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2013-09-05 11:58:12 +0000
committerpjd <pjd@FreeBSD.org>2013-09-05 11:58:12 +0000
commit1c7defb76e774a54509fd6d99f3b65eec088b4e9 (patch)
treecd5d7fc484c0b7940676d61a8ced11ca7372517a /sys/ofed/include/linux
parent12cfeea19a8d4e0050ea00927229c9f934e11828 (diff)
downloadFreeBSD-src-1c7defb76e774a54509fd6d99f3b65eec088b4e9.zip
FreeBSD-src-1c7defb76e774a54509fd6d99f3b65eec088b4e9.tar.gz
Handle cases where capability rights are not provided.
Reported by: kib
Diffstat (limited to 'sys/ofed/include/linux')
-rw-r--r--sys/ofed/include/linux/file.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/ofed/include/linux/file.h b/sys/ofed/include/linux/file.h
index b9bd8b1..bb9d58d 100644
--- a/sys/ofed/include/linux/file.h
+++ b/sys/ofed/include/linux/file.h
@@ -47,8 +47,10 @@ linux_fget(unsigned int fd)
{
struct file *file;
- if (fget_unlocked(curthread->td_proc->p_fd, fd, 0, 0, &file, NULL) != 0)
+ if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, 0, &file,
+ NULL) != 0) {
return (NULL);
+ }
return (struct linux_file *)file->f_data;
}
@@ -70,8 +72,10 @@ put_unused_fd(unsigned int fd)
{
struct file *file;
- if (fget_unlocked(curthread->td_proc->p_fd, fd, 0, 0, &file, NULL) != 0)
+ if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, 0, &file,
+ NULL) != 0) {
return;
+ }
fdclose(curthread->td_proc->p_fd, file, fd, curthread);
}
@@ -80,8 +84,10 @@ fd_install(unsigned int fd, struct linux_file *filp)
{
struct file *file;
- if (fget_unlocked(curthread->td_proc->p_fd, fd, 0, 0, &file, NULL) != 0)
+ if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, 0, &file,
+ NULL) != 0) {
file = NULL;
+ }
filp->_file = file;
finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops);
}
OpenPOWER on IntegriCloud