mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Penglei Jiang <superman.xpt@gmail.com>
Cc: mjguzik@gmail.com, adrian.ratiu@collabora.com,
	brauner@kernel.org, felix.moessbauer@siemens.com,
	jlayton@kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, lorenzo.stoakes@oracle.com,
	syzbot+02e64be5307d72e9c309@syzkaller.appspotmail.com,
	syzbot+f9238a0a31f9b5603fef@syzkaller.appspotmail.com,
	tglx@linutronix.de, viro@zeniv.linux.org.uk, xu.xin16@zte.com.cn
Subject: Re: [PATCH V2] proc: Fix the issue of proc_mem_open returning NULL
Date: Thu, 27 Mar 2025 12:24:45 -0700	[thread overview]
Message-ID: <20250327122445.cbd211c3216aa754917f3677@linux-foundation.org> (raw)
In-Reply-To: <20250325041448.43211-1-superman.xpt@gmail.com>

On Mon, 24 Mar 2025 21:14:48 -0700 Penglei Jiang <superman.xpt@gmail.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?

  reply	other threads:[~2025-03-27 19:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24 16:23 [PATCH] " Penglei Jiang
2025-03-24 17:48 ` Mateusz Guzik
2025-03-25  4:14   ` [PATCH V2] " Penglei Jiang
2025-03-27 19:24     ` Andrew Morton [this message]
2025-03-31  9:16       ` [PATCH V3] " Penglei Jiang
2025-03-31 17:06         ` [PATCH V4] " Penglei Jiang
2025-04-04  6:33           ` [PATCH V5] " Penglei Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250327122445.cbd211c3216aa754917f3677@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=adrian.ratiu@collabora.com \
    --cc=brauner@kernel.org \
    --cc=felix.moessbauer@siemens.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mjguzik@gmail.com \
    --cc=superman.xpt@gmail.com \
    --cc=syzbot+02e64be5307d72e9c309@syzkaller.appspotmail.com \
    --cc=syzbot+f9238a0a31f9b5603fef@syzkaller.appspotmail.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xu.xin16@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®