From: Ralph Campbell <rcampbell@nvidia.com>
To: "Dan Carpenter" <dan.carpenter@oracle.com>,
"Jérôme Glisse" <jglisse@redhat.com>
Cc: <linux-mm@kvack.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] mm/hmm/test: fix an error code in hmm_dmirror_init()
Date: Wed, 13 May 2020 12:08:36 -0700 [thread overview]
Message-ID: <86b773ef-bc31-7d1c-f271-583c1f0a420a@nvidia.com> (raw)
In-Reply-To: <20200513094225.GE347693@mwanda>
On 5/13/20 2:42 AM, Dan Carpenter wrote:
> If the allocation fails, then this should return -ENOMEM instead of
> success.
>
> Fixes: a149d2eb654b ("mm/hmm/test: add selftest driver for HMM")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> lib/test_hmm.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/test_hmm.c b/lib/test_hmm.c
> index 00bca6116f930..b4d9434e49e72 100644
> --- a/lib/test_hmm.c
> +++ b/lib/test_hmm.c
> @@ -1119,8 +1119,10 @@ static int __init hmm_dmirror_init(void)
> * make the code here simpler (i.e., we need a struct page for it).
> */
> dmirror_zero_page = alloc_page(GFP_HIGHUSER | __GFP_ZERO);
> - if (!dmirror_zero_page)
> + if (!dmirror_zero_page) {
> + ret = -ENOMEM;
> goto err_chrdev;
> + }
>
> pr_info("HMM test module loaded. This is only for testing HMM.\n");
> return 0;
>
Thanks for fixing this. It looks like Wei Yongjun beat you to it
and Jason Gunthorpe has applied it to the hmm tree.
https://lore.kernel.org/linux-mm/20200512195932.GB9154@ziepe.ca/
prev parent reply other threads:[~2020-05-13 19:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 9:42 Dan Carpenter
2020-05-13 19:08 ` Ralph Campbell [this message]
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=86b773ef-bc31-7d1c-f271-583c1f0a420a@nvidia.com \
--to=rcampbell@nvidia.com \
--cc=dan.carpenter@oracle.com \
--cc=jglisse@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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