Re: [PATCH] proc: s_fs_info may be NULL when proc_kill_sb is called

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 10, 2020 at 12:12:54PM -0500, Eric W. Biederman wrote:

> >  {
> >  	struct proc_fs_info *fs_info = proc_sb_info(sb);
> >  
> > -	if (fs_info->proc_self)
> > -		dput(fs_info->proc_self);
> > +	if (fs_info) {
> > +		if (fs_info->proc_self)
> > +			dput(fs_info->proc_self);
> >  
> > -	if (fs_info->proc_thread_self)
> > -		dput(fs_info->proc_thread_self);
> > +		if (fs_info->proc_thread_self)
> > +			dput(fs_info->proc_thread_self);
> > +
> > +		put_pid_ns(fs_info->pid_ns);
> > +		kfree(fs_info);

While we are at it, dput(NULL) is an explicit no-op.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux