Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp103602imm; Wed, 3 Oct 2018 12:39:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV62fkzVehPJdlNxffxwurSi6JQN0vUprKK0xawEkC6FBchqUX9qhY96gyI4fFweYt2ej9pfa X-Received: by 2002:a63:f744:: with SMTP id f4-v6mr2724763pgk.410.1538595582837; Wed, 03 Oct 2018 12:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538595582; cv=none; d=google.com; s=arc-20160816; b=tyuLSu5zCLDghqvrf+/dwUyDSeSBHHFm6se8OsVQg/OoSN2ljJ6LVFdRQGe7O3xLle hrJ6bWw2qlQzFuhdLJy7ZqtfXNor9tTqOGGhrkFOHddCOCqa4Qn3kUvna0fMA1tNBkCG sDbXTloe71c4gohZ5TYg8LeWr1Y16Mg5GwRvIc+AzLh8uIlYPfNPoJbFxImx1rLwMOKK e1NzxLqAVu+YGCOCgx2KI09e0KdQVnbNn660h6Rn0/EZ4cOJxbkv0ia5CDWcRk9sTxxU DOkWJrC3X1OT5fz4Vh08n5+Kw/9vmGKpINQEeCJaRgaQ40UrG10ZsynQhF2zMxOTxVCG nlqw== 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=p8K9gAatAwGiqKdxIu+ZApp+EQHG/y8xhXPMJLQOypZpI9Uv6P/3/4ENEt+J2azyVB QUi/+8hl861JEBcZ3ai8z2GlTDaEi9pwfth7bz6+b7256eAdAFduz/UtYmvm7jhe0UBW YYwFN7Tkg59btYnDTaB8YAAMKXxxVgNyrrO8JCqQc9pKs4f+WtT+r5O+a9LFPLPzkR/r 9rzxCoe3iqc9FzmAZvlWspGbZ2OVJ/7Ox42DQ5309aWkaN4WyjPM0TMn7PYDKN+lTsAH LwiLoA6ydU5B/RMkgbSIvep7Fzp8hRsfMiT+sjY8RCDxLua4pOoO8DYZHTfm5w+9FcwS 6Lrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lmuW2Nqx; 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 185-v6si1973247pge.516.2018.10.03.12.39.26; Wed, 03 Oct 2018 12:39: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lmuW2Nqx; 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 S1727318AbeJDC2w (ORCPT + 99 others); Wed, 3 Oct 2018 22:28:52 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:40049 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726964AbeJDC2v (ORCPT ); Wed, 3 Oct 2018 22:28:51 -0400 Received: by mail-ed1-f65.google.com with SMTP id j62-v6so6435464edd.7; Wed, 03 Oct 2018 12:39:04 -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=lmuW2Nqx4zU3tHrg3KDrrV6JiBwTzvLnnIUuMfjZuAetstjFjZ/pa4Zs+VF2kfjLk2 MrB4bG/3/nnDDY2J/LZhV4Oz66MqjspeHCxI6Ty/e4mpSu8SaqsYt2kFzYJW+oaNx0Ml YuPCuWsrsfSkq7mw7RgUqXs4t1SjPjQZkU9EW0bTFf/eGpjwZZlXlTM1FIHnIGSBXRGs LNgJUc0OXLT/AQ9PFqCom8lmerQXKVu6z1oAWOUtiJ7IGfh88Sy1CuzJzbdt7LTlLJRK 46htrVThir9Ue3lV2KFfScMnZ1eWlwKPPwpSHZXzlaW6DKsHCJywhdUI/D5baWJBpvRR vgyQ== 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=DpupEO0mZ/dc5wZnRGo+mNBGewBNr/tVuM0P9A5Qalp1e38NLnUNNaaEBwSSqpQbMa YMaSB7AMTetfJza69HWS8FxmZ4FwimYNZS/KEX5RpnQsyYdbpQwQby6kTFyqwV/uf7gg qTmbnf8zig9+LW69jajES2X+u6fRhKOUKUecZuxB2zZhGNVmcvEf2OKHraqsfGJ34XgH uTCnlLUQYKStxrlZXZa84I48jseuknrSH5FkI9PdxLAwSB7hCc5QX8nNojPl6jRbzZUA iWZlaMBXv2BbX+uop8xkBpxtS/YVaDxvAFgNi5N+mm9DPsY6O7M+KH7HPX5/LO6Hl0h0 9pog== X-Gm-Message-State: ABuFfohiA/rcY677WczUF4uFZFplw7eJLAcQ1A2VdPnVWPMpNa8Bnk2H E3VkiJ8QXldW/EAerMisJvPJbVRQ X-Received: by 2002:a50:8d1b:: with SMTP id s27-v6mr4319626eds.107.1538595543543; Wed, 03 Oct 2018 12:39:03 -0700 (PDT) Received: from piling.lan (80-71-134-83.u.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id b49-v6sm765263eda.70.2018.10.03.12.39.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 12:39:02 -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 v5 2/8] mtd: maps: gpio-addr-flash: Fix ioremapped size Date: Wed, 3 Oct 2018 21:38:53 +0200 Message-Id: <20181003193859.23928-2-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181003193859.23928-1-ricardo.ribalda@gmail.com> References: <20181003193859.23928-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