linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jerome Glisse <jglisse@redhat.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hmm: Warn on devres_release failure
Date: Wed, 26 Dec 2018 17:22:36 -0500	[thread overview]
Message-ID: <20181226222236.GA4931@redhat.com> (raw)
In-Reply-To: <20181226180904.8193-1-pakki001@umn.edu>

On Wed, Dec 26, 2018 at 12:09:04PM -0600, Aditya Pakki wrote:
> devres_release can return -ENOENT if the device is not freed. The fix
> throws a warning consistent with other invocations.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>

Reviewed-by: J�r�me Glisse <jglisse@redhat.com>

> ---
>  mm/hmm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/hmm.c b/mm/hmm.c
> index 90c34f3d1243..b06e3f092fbf 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -1183,8 +1183,12 @@ static int hmm_devmem_match(struct device *dev, void *data, void *match_data)
>  
>  static void hmm_devmem_pages_remove(struct hmm_devmem *devmem)
>  {
> -	devres_release(devmem->device, &hmm_devmem_release,
> -		       &hmm_devmem_match, devmem->resource);
> +	int rc;
> +
> +	rc = devres_release(devmem->device, &hmm_devmem_release,
> +				&hmm_devmem_match, devmem->resource);
> +	if (rc)
> +		WARN_ON(rc);
>  }
>  
>  /*
> -- 
> 2.17.1
> 

WARNING: multiple messages have this Message-ID
From: Jerome Glisse <jglisse@redhat.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hmm: Warn on devres_release failure
Date: Wed, 26 Dec 2018 17:22:36 -0500	[thread overview]
Message-ID: <20181226222236.GA4931@redhat.com> (raw)
Message-ID: <20181226222236.cCH81BSQO23jiwKiYaI_jjBa4x9C-VUoKfhaTnCol9k@z> (raw)
In-Reply-To: <20181226180904.8193-1-pakki001@umn.edu>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 956 bytes --]

On Wed, Dec 26, 2018 at 12:09:04PM -0600, Aditya Pakki wrote:
> devres_release can return -ENOENT if the device is not freed. The fix
> throws a warning consistent with other invocations.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>

Reviewed-by: Jérôme Glisse <jglisse@redhat.com>

> ---
>  mm/hmm.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/hmm.c b/mm/hmm.c
> index 90c34f3d1243..b06e3f092fbf 100644
> --- a/mm/hmm.c
> +++ b/mm/hmm.c
> @@ -1183,8 +1183,12 @@ static int hmm_devmem_match(struct device *dev, void *data, void *match_data)
>  
>  static void hmm_devmem_pages_remove(struct hmm_devmem *devmem)
>  {
> -	devres_release(devmem->device, &hmm_devmem_release,
> -		       &hmm_devmem_match, devmem->resource);
> +	int rc;
> +
> +	rc = devres_release(devmem->device, &hmm_devmem_release,
> +				&hmm_devmem_match, devmem->resource);
> +	if (rc)
> +		WARN_ON(rc);
>  }
>  
>  /*
> -- 
> 2.17.1
> 


  reply	other threads:[~2018-12-26 22:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-26 18:09 Aditya Pakki
2018-12-26 22:22 ` Jerome Glisse [this message]
2018-12-26 22:22   ` Jerome Glisse

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=20181226222236.GA4931@redhat.com \
    --to=jglisse@redhat.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=pakki001@umn.edu \
    /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