Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp396132imm; Thu, 13 Sep 2018 01:27:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdamgeD/LtF5lL/QOB4GVH80WhaYzNUqJK6FuWcUwKX1lLoU/9ReY0vlDorRaPdNpiMosPeU X-Received: by 2002:a62:83ca:: with SMTP id h193-v6mr6306710pfe.123.1536827230704; Thu, 13 Sep 2018 01:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536827230; cv=none; d=google.com; s=arc-20160816; b=OkjDLTRHvM/gvyLJS+bNowS6a3TMQjN2o9U1eYPeSJvzG/TM+0qh+ASdjmqVJ+j5HG zen6YAqybTO5hANRvDwb28fidoqPOS7VfB4ykOJrWXS0ds12757ZlLffI7dsCwTe3lnI 7GuxrJPsUlVaZWOiRo41KmA6T3HHmrH+oOAlNz2+OAgrYQJOlUOWeGHE+htcPwMAJ0+C CpvUqRgHswMs9Hj5hQxhrln5TU5BvTd5WhrmC2xYMG98j4On1vYboVItppKlWXcwOmsj sirljEmw5LJguMf8csE/2B+4PHAswpvmsov3rxq1p3n90rTp3/vdAoVgVLP2JYMVKbbw 8FUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=JgtrbHnHwTk/5VlCA6VBTMlGo+kQRvUrKrMLKSkxyWE=; b=RQbCteOKsgyJKW0ZI6PX56y0FhJXQ2VnpER60Tq5RWKxy3AFjC9L8z9aJTSsrSJzw9 l2L6gPvtyqZPCZZ84LpQP8no6WN8cSdcjFyjTnP3eOtif9qjpgDnivGHIh6HKfyCEfrR KPMgBdkBMQEewDLD9DcdsxnDnVhhKocCx6xKciB1I/9xUJ7PmsuYiTHTUFBA3L+/Kr6M jEacstQW23Fw1fRAlJLBnkjwgjXQhK2RiBZDmmH2/CZkhs7ZaR1WmWMAqIxS0jaFHWto BUgJxIYWAFKJr81GnH0Rt9EnNwgm/fBASCboJgZbTbP4+bR0yOqgTPee0fvyX+nkGxcR Btcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5-v6si3887644pgt.361.2018.09.13.01.26.55; Thu, 13 Sep 2018 01:27:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727403AbeIMNfO (ORCPT + 99 others); Thu, 13 Sep 2018 09:35:14 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:45267 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726394AbeIMNfN (ORCPT ); Thu, 13 Sep 2018 09:35:13 -0400 Received: from p4fea45ac.dip0.t-ipconnect.de ([79.234.69.172] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1g0MxU-0005cg-8e; Thu, 13 Sep 2018 10:26:40 +0200 Date: Thu, 13 Sep 2018 10:26:39 +0200 (CEST) From: Thomas Gleixner To: Chen Yu cc: "Rafael J. Wysocki" , Pavel Machek , Rui Zhang , Chen Yu , Zhimin Gu , Len Brown , linux-kernel@vger.kernel.org, x86@kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH 2/4][v2] PM / hibernate: Check the success of generating md5 digest before hibernation In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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