summaryrefslogtreecommitdiff
path: root/include/linux/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/file.h')
-rw-r--r--include/linux/file.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/file.h b/include/linux/file.h
index b14ff2ffd0bd..d9fee9f5c8da 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -9,6 +9,7 @@
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/posix_types.h>
+#include <linux/errno.h>
struct file;
@@ -96,8 +97,14 @@ extern int __receive_fd(struct file *file, int __user *ufd,
static inline int receive_fd_user(struct file *file, int __user *ufd,
unsigned int o_flags)
{
+ if (ufd == NULL)
+ return -EFAULT;
return __receive_fd(file, ufd, o_flags);
}
+static inline int receive_fd(struct file *file, unsigned int o_flags)
+{
+ return __receive_fd(file, NULL, o_flags);
+}
extern void flush_delayed_fput(void);
extern void __fput_sync(struct file *);