All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralph Campbell <rcampbell@nvidia.com>
To: Wei Yongjun <weiyongjun1@huawei.com>, <jglisse@redhat.com>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<kernel-janitors@vger.kernel.org>, Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH -next] mm/hmm/test: fix missing unlock on error in dmirror_migrate_finalize_and_map()
Date: Mon, 11 May 2020 10:22:01 -0700	[thread overview]
Message-ID: <9f5103ac-4b43-3b4b-d48c-be18f9f2c335@nvidia.com> (raw)
In-Reply-To: <20200509030225.14592-1-weiyongjun1@huawei.com>


On 5/8/20 8:02 PM, Wei Yongjun wrote:
> Add the missing unlock before return from function
> dmirror_migrate_finalize_and_map() in the error
> handling case.
> 
> Fixes: 5d5e54be8a1e ("mm/hmm/test: add selftest driver for HMM")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Looks good, thanks!
Reviewed-by: Ralph Campbell <rcampbell@nvidia.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 00bca6116f93..30462193c4ff 100644
> --- a/lib/test_hmm.c
> +++ b/lib/test_hmm.c
> @@ -647,8 +647,10 @@ static int dmirror_migrate_finalize_and_map(struct migrate_vma *args,
>   		if (*dst & MIGRATE_PFN_WRITE)
>   			entry = xa_tag_pointer(entry, DPT_XA_TAG_WRITE);
>   		entry = xa_store(&dmirror->pt, pfn, entry, GFP_ATOMIC);
> -		if (xa_is_err(entry))
> +		if (xa_is_err(entry)) {
> +			mutex_unlock(&dmirror->mutex);
>   			return xa_err(entry);
> +		}
>   	}
>   
>   	mutex_unlock(&dmirror->mutex);
> 
> 
> 
> 

WARNING: multiple messages have this Message-ID (diff)
From: Ralph Campbell <rcampbell@nvidia.com>
To: Wei Yongjun <weiyongjun1@huawei.com>, jglisse@redhat.com
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org, Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH -next] mm/hmm/test: fix missing unlock on error in dmirror_migrate_finalize_and_map()
Date: Mon, 11 May 2020 17:22:01 +0000	[thread overview]
Message-ID: <9f5103ac-4b43-3b4b-d48c-be18f9f2c335@nvidia.com> (raw)
In-Reply-To: <20200509030225.14592-1-weiyongjun1@huawei.com>


On 5/8/20 8:02 PM, Wei Yongjun wrote:
> Add the missing unlock before return from function
> dmirror_migrate_finalize_and_map() in the error
> handling case.
> 
> Fixes: 5d5e54be8a1e ("mm/hmm/test: add selftest driver for HMM")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Looks good, thanks!
Reviewed-by: Ralph Campbell <rcampbell@nvidia.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 00bca6116f93..30462193c4ff 100644
> --- a/lib/test_hmm.c
> +++ b/lib/test_hmm.c
> @@ -647,8 +647,10 @@ static int dmirror_migrate_finalize_and_map(struct migrate_vma *args,
>   		if (*dst & MIGRATE_PFN_WRITE)
>   			entry = xa_tag_pointer(entry, DPT_XA_TAG_WRITE);
>   		entry = xa_store(&dmirror->pt, pfn, entry, GFP_ATOMIC);
> -		if (xa_is_err(entry))
> +		if (xa_is_err(entry)) {
> +			mutex_unlock(&dmirror->mutex);
>   			return xa_err(entry);
> +		}
>   	}
>   
>   	mutex_unlock(&dmirror->mutex);
> 
> 
> 
> 

  reply	other threads:[~2020-05-11 17:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-09  2:58 [PATCH -next] mm/hmm/test: fix missing unlock on error in dmirror_migrate_finalize_and_map() Wei Yongjun
2020-05-09  3:02 ` Wei Yongjun
2020-05-11 17:22 ` Ralph Campbell [this message]
2020-05-11 17:22   ` Ralph Campbell
2020-05-12 19:59 ` Jason Gunthorpe
2020-05-12 19:59   ` Jason Gunthorpe

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=9f5103ac-4b43-3b4b-d48c-be18f9f2c335@nvidia.com \
    --to=rcampbell@nvidia.com \
    --cc=hulkci@huawei.com \
    --cc=jglisse@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=weiyongjun1@huawei.com \
    /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 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.