From: Dan Carpenter <dan.carpenter@oracle.com> To: "Jérôme Glisse" <jglisse@redhat.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au>, Ralph Campbell <rcampbell@nvidia.com>, Jason Gunthorpe <jgg@ziepe.ca>, Dan Williams <dan.j.williams@intel.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, kernel-janitors@vger.kernel.org Subject: [PATCH] mm/hmm/test: Fix an error code in dmirror_allocate_chunk() Date: Sat, 10 Oct 2020 20:08:12 +0000 [thread overview] Message-ID: <20201010200812.GA1886610@mwanda> (raw) In-Reply-To: <20200513094225.GE347693@mwanda> This is supposed to return false on failure, not a negative error code. Fixes: 170e38548b81 ("mm/hmm/test: use after free in dmirror_allocate_chunk()") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- I messed this up earlier... My devel version of Smatch prints too much garbage so I missed the warning when I first wrote the patch. :/ Sorry. lib/test_hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_hmm.c b/lib/test_hmm.c index e151a7f10519..80a78877bd93 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -461,7 +461,7 @@ static bool dmirror_allocate_chunk(struct dmirror_device *mdevice, devmem = kzalloc(sizeof(*devmem), GFP_KERNEL); if (!devmem) - return -ENOMEM; + return false; res = request_free_mem_region(&iomem_resource, DEVMEM_CHUNK_SIZE, "hmm_dmirror"); -- 2.28.0
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com> To: "Jérôme Glisse" <jglisse@redhat.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au>, Ralph Campbell <rcampbell@nvidia.com>, Jason Gunthorpe <jgg@ziepe.ca>, Dan Williams <dan.j.williams@intel.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, kernel-janitors@vger.kernel.org Subject: [PATCH] mm/hmm/test: Fix an error code in dmirror_allocate_chunk() Date: Sat, 10 Oct 2020 23:08:12 +0300 [thread overview] Message-ID: <20201010200812.GA1886610@mwanda> (raw) This is supposed to return false on failure, not a negative error code. Fixes: 170e38548b81 ("mm/hmm/test: use after free in dmirror_allocate_chunk()") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- I messed this up earlier... My devel version of Smatch prints too much garbage so I missed the warning when I first wrote the patch. :/ Sorry. lib/test_hmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_hmm.c b/lib/test_hmm.c index e151a7f10519..80a78877bd93 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -461,7 +461,7 @@ static bool dmirror_allocate_chunk(struct dmirror_device *mdevice, devmem = kzalloc(sizeof(*devmem), GFP_KERNEL); if (!devmem) - return -ENOMEM; + return false; res = request_free_mem_region(&iomem_resource, DEVMEM_CHUNK_SIZE, "hmm_dmirror"); -- 2.28.0
next prev parent reply other threads:[~2020-10-10 20:08 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-13 9:42 [PATCH] mm/hmm/test: fix an error code in hmm_dmirror_init() Dan Carpenter 2020-05-13 9:42 ` Dan Carpenter 2020-05-13 19:08 ` Ralph Campbell 2020-05-13 19:08 ` Ralph Campbell 2020-10-10 20:08 ` Dan Carpenter [this message] 2020-10-10 20:08 ` [PATCH] mm/hmm/test: Fix an error code in dmirror_allocate_chunk() Dan Carpenter 2020-10-11 20:58 ` Ralph Campbell 2020-10-11 20:58 ` Ralph Campbell
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=20201010200812.GA1886610@mwanda \ --to=dan.carpenter@oracle.com \ --cc=akpm@linux-foundation.org \ --cc=dan.j.williams@intel.com \ --cc=jgg@ziepe.ca \ --cc=jglisse@redhat.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=rcampbell@nvidia.com \ --cc=sfr@canb.auug.org.au \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.