[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1809131024500.1473@nanos.tec.linutronix.de>
Date: Thu, 13 Sep 2018 10:26:39 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Chen Yu <yu.c.chen@...el.com>
cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Pavel Machek <pavel@....cz>, Rui Zhang <rui.zhang@...el.com>,
Chen Yu <yu.chen.surf@...il.com>,
Zhimin Gu <kookoo.gu@...el.com>,
Len Brown <len.brown@...el.com>, linux-kernel@...r.kernel.org,
x86@...nel.org, linux-pm@...r.kernel.org
Subject: Re: [PATCH 2/4][v2] PM / hibernate: Check the success of generating
md5 digest before hibernation
On Wed, 12 Sep 2018, Chen Yu wrote:
> static bool hibernation_e820_mismatch(void *buf)
> @@ -306,6 +307,7 @@ static bool hibernation_e820_mismatch(void *buf)
> int arch_hibernation_header_save(void *addr, unsigned int max_size)
> {
> struct restore_data_record *rdr = addr;
> + int ret = -EINVAL;
What's the point of initializing ret?
> if (max_size < sizeof(struct restore_data_record))
> return -EOVERFLOW;
> @@ -333,7 +335,9 @@ int arch_hibernation_header_save(void *addr, unsigned int max_size)
>
> rdr->magic = RESTORE_MAGIC;
>
> - hibernation_e820_save(rdr->e820_digest);
> + ret = hibernation_e820_save(rdr->e820_digest);
> + if (ret)
> + return ret;
>
> return 0;
And what;s the point of ret at all?
return hibernation_e820_save();
is effectivly the same.
Thanks,
tglx
Powered by blists - more mailing lists