Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5179756imm; Tue, 21 Aug 2018 07:33:25 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzlux1RyevOPr80jYsa2KF8cwmYPHiWcrxKRHiTf6X6X8gbQS/6il1tB7cm4WzubBqO9Lym X-Received: by 2002:a17:902:ba82:: with SMTP id k2-v6mr13484290pls.251.1534862005035; Tue, 21 Aug 2018 07:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534862005; cv=none; d=google.com; s=arc-20160816; b=fURM51klbCS7FENQ6ixysgzhXM0JfhSJ2NSbAUOeQUw8FPMSqzipI1XUtIUQb+Dx9G ey0fxL9jnMC5ZKhOlGn9QXq/6hZIE3F135jmwADps72ulGFGqqtK9FUwb3U80e0BdnHg xXkAZXFqB5Ean4o+JquqI0uBzzbtJRXCo4VwfGnJA7Au72KGT5ViPvchkOqCzNuI4lHS n5/T+ndSq6e/UZPG1hjD5r9pFf0S6OxCnrL7uhN0qVEVekqSAaoGOyYCFRU7qujZKZEH RdTe9yH5YSl01ZckGWheezcP14bsZ3Iyxm+2rPGHHnK6G3D6Rg/QaTrbHhCNzGfvzca5 NI5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Bdw/oXweRo9ZqoVDdPAjPX2cTB/s3gVRxxriYJhxr6E=; b=AAZPHIZmu9yclVtkBY59gVRV173w04h9y51b+t4zLZOxzuYp3aWLlyG/4+9CWPSNUS SJ5ggdF2y+dEjl9aOE5FxbLeURC5TyvnSftkztqBN1n1MJpXN60KPmuW1hxVUD1mQCzM 44Ooqhm2fc948EcecNIEIR7C5pwBC4FwTEXkXYa9kRCqK3/+o1aIJuCWp1e2Ye34BlN5 swlr0XNm7TtG3GeSISYabqGLUm4IlNxNz5aedX8tRrKVQVQa9hSuuZfeSk/etmO2wxGe 8skWGXP5iM+Ssv08nqUUYBjO9kcaNP0TJapxI+YfenryvoDVNi+btgsxsoAlWJJ1jhJO D12Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TuI+wbhO; 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 90-v6si12846603pla.466.2018.08.21.07.33.07; Tue, 21 Aug 2018 07:33:24 -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=TuI+wbhO; 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 S1727463AbeHURwX (ORCPT + 99 others); Tue, 21 Aug 2018 13:52:23 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:45319 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727238AbeHURwX (ORCPT ); Tue, 21 Aug 2018 13:52:23 -0400 Received: by mail-ed1-f65.google.com with SMTP id p52-v6so1183903eda.12 for ; Tue, 21 Aug 2018 07:31:59 -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; bh=Bdw/oXweRo9ZqoVDdPAjPX2cTB/s3gVRxxriYJhxr6E=; b=TuI+wbhONJm5SV4nMWWWhLSmndAX6F/lA93vk5/SN4zPh1985i4wSfRCy080ESXUCu LI7cTkSPKDDa3k4B+SRVm3e8Ne/2IIyi95ErCzSpiVW7edSVla4i+n7YREJi5jiYpOKE oKcuKEkSnHv3F1zCqx5zsKmMV2mzvJVDsvdgmtROYbDehnDqu40T11E92x7qqTPAZlvE OwDFUa6VgDgbhc8jcaPHVvCqgoF0y1AUMdn92dJ1J2cIBqp+ItZxD/e8GH9t0mLRU54d Q234vAnC1yIV7tm3pIWL6aVITAPm58XeJNn5nsJF69Duv/I0dyJ9vMiHyCAX0fGR1Gn9 1wGA== 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; bh=Bdw/oXweRo9ZqoVDdPAjPX2cTB/s3gVRxxriYJhxr6E=; b=BnV4EIuNcrOXaAtQ8nWNNPzgDOSK3IiT1Ns8DJrGafzwyAO4Nho7aVls9f2W2h33Wn OEIkqW4JDK4T0/Htpd/Mi9Li4ebaBmIr6cJeDwvdgkAVYzmBqQBsz8UoW61cIIX8iNMT mTDBVMYYcQXFfTlYhFdFJ6jNz2rXmzq4nPIVG0qvrTD/i6kQHmmhnB7wOsKMtayzxzKT 1Ihmks+5jKkXsKngFBNlz+X70UWbP005TfNAcDIOR9tPl7UEoJT9ofBTqBy6o1EfrhyR zm+t2CjAOfXUzb6pvaaAdxbiSB9Dt0ndqosZqj3y9pHvImePKI4aiXeSt3Xn+VKf5Gkp iK8g== X-Gm-Message-State: APzg51DG0hLdW2qJeasd5pGEPctGo82y+r/zzs/KIua6jaqQu7K//MpD 0X/vq+uizK6N295FsMZ4cpQ= X-Received: by 2002:aa7:d70b:: with SMTP id t11-v6mr3554787edq.137.1534861918689; Tue, 21 Aug 2018 07:31:58 -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 n17-v6sm6766144edq.10.2018.08.21.07.31.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 07:31:57 -0700 (PDT) From: Ricardo Ribalda Delgado To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Zhouyang Jia , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 2/8] mtd: maps: gpio-addr-flash: Fix ioremapped size Date: Tue, 21 Aug 2018 16:31:46 +0200 Message-Id: <20180821143152.32293-3-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180821143152.32293-1-ricardo.ribalda@gmail.com> References: <20180821143152.32293-1-ricardo.ribalda@gmail.com> 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 --- 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.18.0