Received: by 10.192.165.148 with SMTP id m20csp2428323imm; Sun, 22 Apr 2018 06:58:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+WPOGLv2hmLSmp4fI84nthTBieBxhLpSMzTWEDDT6xPQFgub15MyrWgGgniCkCJWCOdbD4 X-Received: by 10.98.178.208 with SMTP id z77mr16552154pfl.122.1524405522546; Sun, 22 Apr 2018 06:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524405522; cv=none; d=google.com; s=arc-20160816; b=f5v6usapGl0+BvGhbjbqJ77f0SomUcG4cQLO4mwZ66KpZZRmYYQhlSJ9UsTB1wdHlT x2cFc/X6LkscRWjqLfHy3Uzg13XL9dpNVjSMVa2zwOsELJKsreokBe5sE3Q+3vVSqEsa IB2v1Le4/j9hMq0FotefmKSYiY0Ihh60KVpb9Ni/OasLT139SBXZSlqdA6OYqjl58IW6 o8AzP8GH6PNR17ocpdJSkdtC99MvK4viK6Jn+6Vi+3DsAKXXV4U6IAtWC0SDgaYvOvAZ cK/3LVEJDbasjjeJpW4vVpuOe4kudkGqiCxrWYD7eBfv6bw22oWPNKVgXl9lH5aZNxWz LHDw== 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=6jgVBpImNg0eIp8i1PB/v7XxBBuItkg8Jep67odsNnU=; b=JBXngZj6F0x3LyNiOspXGd0xOTzyiukxBsZlCDE48z4gRvqxlykeAzPf1RSgcfz7h6 8J1MWBQb6kcmJyQxNNMbhvF1NBgSJ0MbJN3kuVcRr7279/aS3CBtyOgZiHctJWWA61kR D9h6MqcXHuuR0JIPbpbPWQMkuasWDCwgRE6j47ZEUsv1tEFV7E2Bkua83RFlP3q3p3C6 VaX+HvwNmp2pp5/pCSByfe7NGzm+a3TaJQp6mVDYSbR6pmwuOHoQW7f1ZoTPDWIoXc1h qXBGPqU15N0s8hV/xc8tbKTQeMDlgvD+Tuz2xZKCEikiquxc3WTkoIsR0WPeqrRHUAFg mBjw== 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 o128si8066198pga.653.2018.04.22.06.58.28; Sun, 22 Apr 2018 06:58:42 -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 S1753912AbeDVN5D (ORCPT + 99 others); Sun, 22 Apr 2018 09:57:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45468 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753838AbeDVN47 (ORCPT ); Sun, 22 Apr 2018 09:56:59 -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 5F7C19F0; Sun, 22 Apr 2018 13:56:58 +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.16 060/196] powerpc/powernv: Handle unknown OPAL errors in opal_nvram_write() Date: Sun, 22 Apr 2018 15:51:20 +0200 Message-Id: <20180422135107.330955155@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@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.16-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; }