[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1454338315-13465-5-git-send-email-roman.penyaev@profitbricks.com>
Date: Mon, 1 Feb 2016 15:51:55 +0100
From: Roman Pen <roman.penyaev@...fitbricks.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Roman Pen <roman.penyaev@...fitbricks.com>,
Gi-Oh Kim <gi-oh.kim@...fitbricks.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 4/4] hibernate: fix disk and module leak on successfull resume
Do not forget to put the disk back.
Signed-off-by: Roman Pen <roman.penyaev@...fitbricks.com>
Cc: Gi-Oh Kim <gi-oh.kim@...fitbricks.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Len Brown <len.brown@...el.com>
Cc: Pavel Machek <pavel@....cz>
Cc: linux-pm@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
kernel/power/hibernate.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index b7342a2..1f53dc2 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -785,8 +785,11 @@ static int software_resume(void)
*/
if (isdigit(resume_file[0]) && resume_wait) {
int partno;
- while (!get_gendisk(swsusp_resume_device, &partno))
+ struct gendisk *disk;
+
+ while (!(disk = get_gendisk(swsusp_resume_device, &partno)))
msleep(10);
+ put_gendisk(disk);
}
if (!swsusp_resume_device) {
--
2.6.2
Powered by blists - more mailing lists