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

Commit f99d49ad authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds
Browse files

[PATCH] kfree cleanup: fs



This is the fs/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in fs/.

Signed-off-by: default avatarJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6044ec88
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -269,7 +269,6 @@ static void v9fs_sock_close(struct v9fs_transport *trans)
		dprintk(DEBUG_TRANS, "socket closed\n");
	}

	if (ts)
	kfree(ts);

	trans->priv = NULL;
+6 −10
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ affs_put_super(struct super_block *sb)
		mark_buffer_dirty(sbi->s_root_bh);
	}

	if (sbi->s_prefix)
	kfree(sbi->s_prefix);
	affs_free_bitmap(sb);
	affs_brelse(sbi->s_root_bh);
@@ -198,10 +197,9 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
			*mount_opts |= SF_MUFS;
			break;
		case Opt_prefix:
			if (*prefix) {		/* Free any previous prefix */
			/* Free any previous prefix */
			kfree(*prefix);
			*prefix = NULL;
			}
			*prefix = match_strdup(&args[0]);
			if (!*prefix)
				return 0;
@@ -462,10 +460,8 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
out_error:
	if (root_inode)
		iput(root_inode);
	if (sbi->s_bitmap)
	kfree(sbi->s_bitmap);
	affs_brelse(root_bh);
	if (sbi->s_prefix)
	kfree(sbi->s_prefix);
	kfree(sbi);
	sb->s_fs_info = NULL;
+1 −2
Original line number Diff line number Diff line
@@ -265,7 +265,6 @@ static int afs_file_releasepage(struct page *page, gfp_t gfp_flags)
		set_page_private(page, 0);
		ClearPagePrivate(page);

		if (pageio)
		kfree(pageio);
	}

+2 −4
Original line number Diff line number Diff line
@@ -150,11 +150,9 @@ int autofs_wait(struct autofs_sb_info *sbi, struct qstr *name)
	if ( sbi->catatonic ) {
		/* We might have slept, so check again for catatonic mode */
		wq->status = -ENOENT;
		if ( wq->name ) {
		kfree(wq->name);
		wq->name = NULL;
	}
	}

	if ( wq->name ) {
		/* Block all but "shutdown" signals while waiting */
+2 −4
Original line number Diff line number Diff line
@@ -22,11 +22,9 @@

static void ino_lnkfree(struct autofs_info *ino)
{
	if (ino->u.symlink) {
	kfree(ino->u.symlink);
	ino->u.symlink = NULL;
}
}

struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
				     struct autofs_sb_info *sbi, mode_t mode)
Loading