[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250327122445.cbd211c3216aa754917f3677@linux-foundation.org>
Date: Thu, 27 Mar 2025 12:24:45 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Penglei Jiang <superman.xpt@...il.com>
Cc: mjguzik@...il.com, adrian.ratiu@...labora.com, brauner@...nel.org,
felix.moessbauer@...mens.com, jlayton@...nel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
lorenzo.stoakes@...cle.com,
syzbot+02e64be5307d72e9c309@...kaller.appspotmail.com,
syzbot+f9238a0a31f9b5603fef@...kaller.appspotmail.com, tglx@...utronix.de,
viro@...iv.linux.org.uk, xu.xin16@....com.cn
Subject: Re: [PATCH V2] proc: Fix the issue of proc_mem_open returning NULL
On Mon, 24 Mar 2025 21:14:48 -0700 Penglei Jiang <superman.xpt@...il.com> wrote:
> > > if (IS_ERR(mm))
> > > -return mm == ERR_PTR(-ESRCH) ? NULL : mm;
> > > +return mm;
> > >
> > > /* ensure this mm_struct can't be freed */
> > > mmgrab(mm);
> > > --
> > > 2.17.1
> > >
>
> Mateusz Guzik provides valuable suggestions.
>
> Complete the missing NULL checks.
proc_mem_open() can return errno, NULL or mm_struct*. It isn't obvious
why.
While you're in there can you please add documentation to
proc_mem_open() which explains its return values?
Powered by blists - more mailing lists