Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72c2d531 authored by Al Viro's avatar Al Viro
Browse files

file->f_op is never NULL...



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 22bd002e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -575,7 +575,7 @@ static int alloc_device(struct nandsim *ns)
		cfile = filp_open(cache_file, O_CREAT | O_RDWR | O_LARGEFILE, 0600);
		if (IS_ERR(cfile))
			return PTR_ERR(cfile);
		if (!cfile->f_op || (!cfile->f_op->read && !cfile->f_op->aio_read)) {
		if (!cfile->f_op->read && !cfile->f_op->aio_read) {
			NS_ERR("alloc_device: cache file not readable\n");
			err = -EINVAL;
			goto err_close;
+0 −3
Original line number Diff line number Diff line
@@ -86,9 +86,6 @@ struct comedi32_insnlist_struct {
static int translated_ioctl(struct file *file, unsigned int cmd,
			    unsigned long arg)
{
	if (!file->f_op)
		return -ENOTTY;

	if (file->f_op->unlocked_ioctl)
		return file->f_op->unlocked_ioctl(file, cmd, arg);

+1 −1
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ void autofs4_clean_ino(struct autofs_info *);

static inline int autofs_prepare_pipe(struct file *pipe)
{
	if (!pipe->f_op || !pipe->f_op->write)
	if (!pipe->f_op->write)
		return -EINVAL;
	if (!S_ISFIFO(file_inode(pipe)->i_mode))
		return -EINVAL;
+0 −6
Original line number Diff line number Diff line
@@ -658,12 +658,6 @@ static int _autofs_dev_ioctl(unsigned int command, struct autofs_dev_ioctl __use
			goto out;
		}

		if (!fp->f_op) {
			err = -ENOTTY;
			fput(fp);
			goto out;
		}

		sbi = autofs_dev_ioctl_sbi(fp);
		if (!sbi || sbi->magic != AUTOFS_SBI_MAGIC) {
			err = -EINVAL;
+2 −2
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ static int load_aout_binary(struct linux_binprm * bprm)
	 * Requires a mmap handler. This prevents people from using a.out
	 * as part of an exploit attack against /proc-related vulnerabilities.
	 */
	if (!bprm->file->f_op || !bprm->file->f_op->mmap)
	if (!bprm->file->f_op->mmap)
		return -ENOEXEC;

	fd_offset = N_TXTOFF(ex);
@@ -374,7 +374,7 @@ static int load_aout_library(struct file *file)
	 * Requires a mmap handler. This prevents people from using a.out
	 * as part of an exploit attack against /proc-related vulnerabilities.
	 */
	if (!file->f_op || !file->f_op->mmap)
	if (!file->f_op->mmap)
		goto out;

	if (N_FLAGS(ex))
Loading