[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2052409.7mYyWn9zFL@vostro.rjw.lan>
Date: Wed, 03 Feb 2016 02:37:27 +0100
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: Roman Pen <roman.penyaev@...fitbricks.com>
Cc: Gi-Oh Kim <gi-oh.kim@...fitbricks.com>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] hibernate: fix disk and module leak on successfull resume
On Monday, February 01, 2016 03:51:55 PM Roman Pen wrote:
> 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
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> ---
> 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) {
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
Powered by blists - more mailing lists