lkml.org 
[lkml]   [2020]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] proc: s_fs_info may be NULL when proc_kill_sb is called
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.

\
 
 \ /
  Last update: 2020-06-10 19:42    [W:0.050 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site