Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp944270imm; Thu, 4 Oct 2018 06:02:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV63dG/h+qCHMvQQXXkq21qqQPxbdzRlN89JL3qz6WwE6Yj5SwPbouTbUOn4RE2hXk4GTRKc+ X-Received: by 2002:a17:902:bc8b:: with SMTP id bb11-v6mr6591443plb.112.1538658120696; Thu, 04 Oct 2018 06:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538658120; cv=none; d=google.com; s=arc-20160816; b=Z8Wqc+vfPQa9KZC/nq1w3hteg7AVNLe6F5NphNZZr2BATaA8PjUhg3e/JWQkdodXOL wG49qTPtoXdkJp3kV80kJaYi6nMO95FSJOxp+yfArA4i0kgOAUnoP7oWoYN3PcM/iuuR GfsrF9EoyLQc55lgqbT5sKlEXb7D3OUmP41Xt1lY4FLrHZ0hkT8kiHf/nYV2qRWUuEqk uVfyBxoGGHf1pFt0U0PRkP47S2/e/wyWKmKqTAft2aIqZmUIRWfOBnInpnlpMhMlYHQY qXZZYysO248+2DkL03tBcDvDVDARQjNDP6KxOmA5okuLPK83MtpAwi9DLFhafSv4rKpq 5zGw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PjA+sX8gLHXduyIAmFIqULLnywYjal55pxx0KrC3qkQ=; b=pvFMCQJe7sbljtMhoFvJr3x4Jv1MSh+SwNLZXKmfvDaelkUoguL53uExl5ZDd56ro7 RdVYkIRL4JIDoXlXD4Vip184C6oCb9Ksa8i/txwJooiY+H4/WWeNFjp8AbbP2LKLkNOZ fT8irzFVI2EUpR0iBLwD3AyGidpm+fqcCzqUWrVeJATnthzawlKRkg6fBbY1RC/vGKUg CMu35pNXjeMNnGdxHBMT9LoCzFXANIBpw9WyHP+WLTVSxTbd5/toE9dm0yBUtvI4nm8p +DZ8EiLpFghL588pxO6dI+aye9z3MBiN+++wQWm+MZxKnG1IPOBShVrmLe43bv8N+lJM lHQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DaC08QwA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a16-v6si3754052pfi.34.2018.10.04.06.01.44; Thu, 04 Oct 2018 06:02:00 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DaC08QwA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727599AbeJDTym (ORCPT + 99 others); Thu, 4 Oct 2018 15:54:42 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:44347 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727256AbeJDTym (ORCPT ); Thu, 4 Oct 2018 15:54:42 -0400 Received: by mail-lj1-f195.google.com with SMTP id v6-v6so8268119ljc.11; Thu, 04 Oct 2018 06:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PjA+sX8gLHXduyIAmFIqULLnywYjal55pxx0KrC3qkQ=; b=DaC08QwAwE2cTfCAxrM3F28jYNckLgd4bT6mvCs6SzyUnE4Z+snHTMWUQyBVzz824t yFGiDNK4pL5N545rt2WiyO3uEQKEE63uQFYHakxUF0jDDcbxsHhZd3bmOc+0W5VWToQg 4Nhom2t70glWhW8zmlkPmZ9zXWr9jvgJ2SWRxhE1+PuGzpqv9fwMmModxGj4rEApomQc XWILzzApBGS2doFsZk7W3/RNfFFatADTGCbnXOuoyd6VBKIKpay14f/qdsm0VRiTipnp Ncwlfv38+s1MjdU9a7OiN0EqofBFeFpZNo1Zi+VJU8Lt4ElV1U6S4Q5XNGd1Z+w+SN17 1rQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PjA+sX8gLHXduyIAmFIqULLnywYjal55pxx0KrC3qkQ=; b=XPIy4roH79hoTZX9cT/aM4baoSSriTkm02m4nVuJR8KdKTEJaDpyirckqjMp3QYPlC XUbB4bmYKgIxljFUKo90nUL3rIppCCLRRtd7JmwjnqlSKBZySkq3AOT+MM5dxvvnUiw/ PS8Elp61WfGMV/Tg5pqU/rnvK6RrIkjqBlhw9IkTkO6t1GdnwilXkj1pFbtN8WCTx1fN +pVW5OkukwXjcKTMNVosoegiB1YrQ/ZcWj8TmN9Jb930D+a47+0Y8pcraKPDjvENuAGN 4mlyAMxAZ0MuZvKNVzDNh2LSP+JeJ2Mvn1g6ooPQSGscpSMuyQZr6ve1dx0BQApXVKdv 4X/Q== X-Gm-Message-State: ABuFfoieMEGUkHw+dOELRtDbAZnikLYQsq6rQ2Mm6vEF5sBU6qa9XbUE AgmlLt1rknFbdWdejEP37bY= X-Received: by 2002:a2e:3918:: with SMTP id g24-v6mr4093315lja.113.1538658088406; Thu, 04 Oct 2018 06:01:28 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id a1-v6sm421415lfk.63.2018.10.04.06.01.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Oct 2018 06:01:27 -0700 (PDT) From: Ricardo Ribalda Delgado To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Zhouyang Jia , linux-mtd@lists.infradead.org, open list Cc: Ricardo Ribalda Delgado , stable@vger.kernel.org Subject: [PATCH v6 04/10] mtd: maps: gpio-addr-flash: Fix ioremapped size Date: Thu, 4 Oct 2018 15:01:04 +0200 Message-Id: <20181004130110.8496-4-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181004130110.8496-1-ricardo.ribalda@gmail.com> References: <20181004130110.8496-1-ricardo.ribalda@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We should only iomap the area of the chip that is memory mapped. Otherwise we could be mapping devices beyond the memory space or that belong to other devices. Signed-off-by: Ricardo Ribalda Delgado Fixes: ebd71e3a4861 ("mtd: maps: gpio-addr-flash: fix warnings and make more portable") Cc: --- drivers/mtd/maps/gpio-addr-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c index 17be47f72973..6de16e81994c 100644 --- a/drivers/mtd/maps/gpio-addr-flash.c +++ b/drivers/mtd/maps/gpio-addr-flash.c @@ -234,7 +234,7 @@ static int gpio_flash_probe(struct platform_device *pdev) state->map.copy_to = gf_copy_to; state->map.bankwidth = pdata->width; state->map.size = state->win_size * (1 << state->gpio_count); - state->map.virt = ioremap_nocache(memory->start, state->map.size); + state->map.virt = ioremap_nocache(memory->start, state->win_size); if (!state->map.virt) return -ENOMEM; -- 2.19.0