Received: by 10.192.165.148 with SMTP id m20csp2467977imm; Sun, 22 Apr 2018 07:39:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/rDPMHvxU/6L+WO+Bk2TG/+nHz4qV3cO1SacCFAKrMoPfPEe20Gu+/YBXTmexouOY1wfpY X-Received: by 10.167.133.66 with SMTP id y2mr16920968pfn.210.1524407996873; Sun, 22 Apr 2018 07:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524407996; cv=none; d=google.com; s=arc-20160816; b=BXknLbpe31/IGEL/IwzGVh0IeCqEKSGVjDiFD9r8QJXMzXxuc9uDTxORvhONbCf+rJ u4jENT6gpFkWYxteWCqdkrHi268CLjLkIpmX0Eh/htrkfpYbam3GOS/+0bvUQozBjIYJ WdxZiaJpWV+a5o8x7im7GeRBVnly101EPYE+m/r9K2k9g0PBjMVTwtzzjFG9ZiP6ty8C 0pD2jmTFFBba2BIFdF4jGbNKuI5bf0GD1f6PZlRvU2jMx9UaBOSbnlxwJrOFWXJzpTXx UgIqAemenLr11mcSpSpFXX9099slJGeM8CYeFeqSCFM+7tE66NbkI0eaTQnQI/svUf+e y9fw== 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 :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=oNGkQmgzkdOmRjeGnr7HvCxbvxodQXGRmUjdHrKjsio=; b=OFr9ExaA2BS5dbU/KTXrhdjGAbuKvy5b8Ma0MhfqFc8qFWnHEz4APoqzb+FjuIy1lO 1NBxv10aswGp/n5kZDvYS9sHhxLAPbtFLVBjMXeP7/uKYgYBxe0WpPbCHIY4v4Ak84/i jnTtfdjsE2lKyOQe1I1C/iPUxEhb7ge9b13wFss6MNTs2iErHsPNrpsNTV45xzrL3bLW DOkk97IOj0SjJ6zUBcCEAUaU9zhrNWOLUDzDja9eg1Cd7SHceLLHjJbCYKXgeWNPJBLU FmqykvGS/1xIOh0jGT4Mp5NgLW2ubpaGMCw67vC41m8kWB2Q9F4ydN4iQGOaA52tgzEl 8EvQ== 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 s2si7654320pge.176.2018.04.22.07.39.42; Sun, 22 Apr 2018 07:39:56 -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 S1757375AbeDVOiZ (ORCPT + 99 others); Sun, 22 Apr 2018 10:38:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58984 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757261AbeDVOSb (ORCPT ); Sun, 22 Apr 2018 10:18:31 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 478F6D08; Sun, 22 Apr 2018 14:18:30 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Piggin , Vasant Hegde , Stewart Smith , Michael Ellerman Subject: [PATCH 4.4 40/97] powerpc/powernv: Handle unknown OPAL errors in opal_nvram_write() Date: Sun, 22 Apr 2018 15:53:18 +0200 Message-Id: <20180422135307.561031543@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135304.577223025@linuxfoundation.org> References: <20180422135304.577223025@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nicholas Piggin commit 741de617661794246f84a21a02fc5e327bffc9ad upstream. opal_nvram_write currently just assumes success if it encounters an error other than OPAL_BUSY or OPAL_BUSY_EVENT. Have it return -EIO on other errors instead. Fixes: 628daa8d5abf ("powerpc/powernv: Add RTC and NVRAM support plus RTAS fallbacks") Cc: stable@vger.kernel.org # v3.2+ Signed-off-by: Nicholas Piggin Reviewed-by: Vasant Hegde Acked-by: Stewart Smith Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/powernv/opal-nvram.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/arch/powerpc/platforms/powernv/opal-nvram.c +++ b/arch/powerpc/platforms/powernv/opal-nvram.c @@ -59,6 +59,10 @@ static ssize_t opal_nvram_write(char *bu if (rc == OPAL_BUSY_EVENT) opal_poll_events(NULL); } + + if (rc) + return -EIO; + *index += count; return count; }