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

Commit cac71121 authored by Krzysztof Sachanowicz's avatar Krzysztof Sachanowicz Committed by Linus Torvalds
Browse files

proc: proc_get_inode should de_put when inode already initialized



de_get is called before every proc_get_inode, but corresponding de_put is
called only when dropping last reference to an inode. This might cause
something like
remove_proc_entry: /proc/stats busy, count=14496
to be printed to the syslog.

The fix is to call de_put in case of an already initialized inode in
proc_get_inode.

Signed-off-by: default avatarKrzysztof Sachanowicz <analyzer1@gmail.com>
Tested-by: default avatarMarcin Pilipczuk <marcin.pilipczuk@gmail.com>
Acked-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 226485e9
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -485,8 +485,10 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
			}
			}
		}
		}
		unlock_new_inode(inode);
		unlock_new_inode(inode);
	} else
	} else {
	       module_put(de->owner);
	       module_put(de->owner);
	       de_put(de);
	}
	return inode;
	return inode;


out_ino:
out_ino: