[RH7,2/2] lost css_put in hwpoison_filter_task()

Submitted by Vasily Averin on Feb. 12, 2020, 6:16 a.m.

Details

Message ID bd85e883-a9a1-5561-8ecf-4278c1078665@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Vasily Averin Feb. 12, 2020, 6:16 a.m.
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 mm/memory-failure.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 643ec1aa8d1f..b6f47c2e823a 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -146,9 +146,10 @@  static int hwpoison_filter_task(struct page *p)
 
 	css = mem_cgroup_css(mem);
 	/* root_mem_cgroup has NULL dentries */
-	if (!css->cgroup->dentry)
+	if (!css->cgroup->dentry) {
+		css_put(css);
 		return -EINVAL;
-
+	}
 	ino = css->cgroup->dentry->d_inode->i_ino;
 	css_put(css);