Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp731507imm; Thu, 13 Sep 2018 06:59:06 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbo2es76P8Ngy6a5EFdDKIXE5DhSsJoWgEs02RmMxZTqK9630v0UGHRhJU/PP2S4retMIhf X-Received: by 2002:a63:7f55:: with SMTP id p21-v6mr7332152pgn.285.1536847146806; Thu, 13 Sep 2018 06:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847146; cv=none; d=google.com; s=arc-20160816; b=SgnzpGkSGXf6r7nbAj5pQk0CJsL9w6MhetjN/uYyNqioauRqxQO+pCsq0OhwM+o+Sj nwbxaY91ptwb3XMCQfF81MeIXvu/41qKL0Yu8mKSy2VkuPIRkdkkgcNPA9NCGWsN4hcI 7CYuP+POp4ccyfhFscb6oUNq9gZsMcFhHLWFzJd4dpd3hCXgKgIpZRbUYoDDFfD9Tp6P 2eNTg8Tkvk03GkG4WeEeXPNgiJHeyEZ/Uv7G10/kidNh88sjcWn7SmD2ZrCEI76unXPC Fo/JQ6UPJ8F7oa4A/zOGEHlijKh5WuksKiglYu5kXLhSadpy5K8vfI5dNT21r/Kf0r7Y M0sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=n4hyO3RqdtGAGC2hwXYXOR2dOn1DuNLuOjpqE7xSFJk=; b=uebXmkI9e/OBbedqcDWW3lHNESa5JZTbUjGJSmIW18wBA+j0RdLSy/N5HxFzha7Gtp 29AT1kLSSNNWP7IufPwpSVOXt+aMM+QMvwkGxUDLrVgI4rrSm6Ta7nG/KneeOKaJPpuO PeX7OQO8sxk0lxdpRsb92NubW1fbNzSEZLPfywL8g7zQMM6xl1yn/yx91fSfiLNzCOux 2yWLHotzQnvR1bPD1/vG1/Yf3hBvSq8gW8gRzmntwleaLGmgjt6AQfIwivZBdf/aS1g1 BpfHYmQZ5L4uSqFJVK/niuYaHIuPLP8irlW3UBc3dJHE9w2d5cu240kkmymtzuz3Nmh6 Qk7A== 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 n1-v6si3969913pld.429.2018.09.13.06.58.51; Thu, 13 Sep 2018 06:59:06 -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 S1731473AbeIMTHH (ORCPT + 99 others); Thu, 13 Sep 2018 15:07:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34380 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728566AbeIMTHH (ORCPT ); Thu, 13 Sep 2018 15:07:07 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6AAFED10; Thu, 13 Sep 2018 13:57:30 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Tyrel Datwyler , Michael Ellerman , Sasha Levin Subject: [PATCH 4.18 099/197] powerpc: Fix size calculation using resource_size() Date: Thu, 13 Sep 2018 15:30:48 +0200 Message-Id: <20180913131845.499388508@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter [ Upstream commit c42d3be0c06f0c1c416054022aa535c08a1f9b39 ] The problem is the the calculation should be "end - start + 1" but the plus one is missing in this calculation. Fixes: 8626816e905e ("powerpc: add support for MPIC message register API") Signed-off-by: Dan Carpenter Reviewed-by: Tyrel Datwyler Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/sysdev/mpic_msgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c @@ -196,7 +196,7 @@ static int mpic_msgr_probe(struct platfo /* IO map the message register block. */ of_address_to_resource(np, 0, &rsrc); - msgr_block_addr = ioremap(rsrc.start, rsrc.end - rsrc.start); + msgr_block_addr = ioremap(rsrc.start, resource_size(&rsrc)); if (!msgr_block_addr) { dev_err(&dev->dev, "Failed to iomap MPIC message registers"); return -EFAULT;