diff mbox

fs: Check return value of ->show_devname

Message ID 1421844412-15398-1-git-send-email-jack@suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kara Jan. 21, 2015, 12:46 p.m. UTC
show_vfsstat() isn't checking the return value of ->show_devname().
Check it and bail out properly.

Coverity-id: 1260113
Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/proc_namespace.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c
index 0f96f71ab32b..a29f17a9070f 100644
--- a/fs/proc_namespace.c
+++ b/fs/proc_namespace.c
@@ -195,6 +195,8 @@  static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt)
 	if (sb->s_op->show_devname) {
 		seq_puts(m, "device ");
 		err = sb->s_op->show_devname(m, mnt_path.dentry);
+		if (err)
+			goto out;
 	} else {
 		if (r->mnt_devname) {
 			seq_puts(m, "device ");