Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1...
[cascardo/linux.git] / fs / autofs4 / dev-ioctl.c
index 1442da4..509fe1e 100644 (file)
@@ -372,6 +372,10 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp,
                return -EBUSY;
        } else {
                struct file *pipe = fget(pipefd);
+               if (!pipe) {
+                       err = -EBADF;
+                       goto out;
+               }
                if (!pipe->f_op || !pipe->f_op->write) {
                        err = -EPIPE;
                        fput(pipe);