lkml.org 
[lkml]   [2018]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] hmm: Warn on devres_release failure
Date
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>
---
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
\
 
 \ /
  Last update: 2018-12-26 19:10    [W:0.031 / U:24.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site