Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3857710imm; Mon, 1 Oct 2018 05:46:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV62DUm1ggoVXy+w+yDTYIkDydSIRrnhPma0YFWNdqzruan9tYP0TpZUr4BpyBwFS18UOIpjo X-Received: by 2002:a63:9507:: with SMTP id p7-v6mr1612221pgd.449.1538397962620; Mon, 01 Oct 2018 05:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538397962; cv=none; d=google.com; s=arc-20160816; b=u0W+Ia2CttiZf6djvmNWaeBNxsypV3QLiwvWslkhAZxVviF4yB++cghVuR9O1TK+CR P3gO6Lo0iAejm5dckUs0TN2r6bNmA8KHWnr83qLWEn/cH9bMvMjjXMeyp5nlTHhBzHU3 C8Fg8o/Vp8jY4xwrLzhDK8RI3DvmT2LU7r4D8awSIU3Uxkvb7F8oiYjjx8nhhyGcZF8x 5k+uaz49IfS8Y7EJPPRp3OhYzRbHo3O/gmPSjPd4qcupyD+PHaKn3/bVtjLFl+iRZ5XL /Qrvgn/Yy8QY9dMjhMYa+WsoCL82/DAR6pVZOdO6aB0llKCTapoMtoSghnB918QVp18W JtkQ== 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=k6iFLh4AH3G39XPultolnCqX9qJkPgvRLDKBqEpseD/NzSOu4d6F2eOMotXQs/PbST MG/cDt7S+4GbCM4iedzBmaOo5Yy38+Te8WQ5chiBLqqx/8gQUJdUD/VpSot5ftUXXgRT J6x2GGFH0+NPvCh0NMPccT5f69iljUB5GKyQ5AD7p9RsJQG3k9bLnFqg5oEHQFMYiwTD 9dFkGQh/TBFUDTX2k2clLDHdZFW6SU5XtJh7uySivxmdOgYVqvOEgBLry/S4mstHUYEA GwgQf2hHYqpsEZQnWWDDQBs3dYT1oyY8mm63W+4cx1/k+t4LqcvF90NJmDZuO+xj9NVn py0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lXw1cxYY; 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 w31-v6si12369732pla.133.2018.10.01.05.45.48; Mon, 01 Oct 2018 05:46:02 -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=lXw1cxYY; 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 S1729446AbeJATVi (ORCPT + 99 others); Mon, 1 Oct 2018 15:21:38 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37584 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729383AbeJATVg (ORCPT ); Mon, 1 Oct 2018 15:21:36 -0400 Received: by mail-ed1-f67.google.com with SMTP id c22-v6so452122edc.4; Mon, 01 Oct 2018 05:43:57 -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=lXw1cxYYCtUrLg0YYrga2UDS1ZivVZ/ng+77GzCFIoU5hC75yEN2m3ejM3ke1IFZ75 sNefg+NCULYlSiAUREggvFCnlKtanACvz6+NOKL/n6m5I8LmvQANWmxMFVny8fMUPdVr bIpkkBklIXxhiZ5XAZEF9wgdo71tJUSGQ3NHY+OfVpdBhF+AB6brGrKLT9mZRRHgn8EW Kb6h0NxjqooTcddC4+MPpytB7brfpnhjGWXzuTFO4H/4lXquXjuoOcYRsg55Pw2Zwv9r qvfTe/Xmw77Ytoe7wYJkpy2NCsfqhumQxIA6J5D5VdpZMbqunoa6nuRZOjTqpw1Fug5B 7bHw== 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=seFLmRau6turTXduPAwswe+7syhxoC1oDy1nz965RlsxH0QWImfYlZgXJH2GZ0vWQJ v18Swzn/9ZRR7wlFto3j9x4hnEOSmjiD2A4ljOGbnXqJUk/SO0LS93TXwPuxOXxnfedZ aFV1KtOmQmUnKXNZPBf+Lu5V0l0h1a2ImCi+Ss1Q12KXonbvm+rn9EgdjXnWnxFf2TXX r7UsQEn4wHsIo1uDpJ2eWW/SWR4LoaAxfX+iM8TX4CdlrBi8A+BhnK5l/uR2Qn1S5iyq 6QUNiJ8BfLwzTgNXIpVoHUiI5hR94n450X3vjFpDQfMeQpNu/QDFLwjUs/2u2oe2xvx2 nzeA== X-Gm-Message-State: ABuFfoh1lyPdOfFvpuwD8EZToSMLbpGj6cpQmTqYP0vz5g3nVeuKJk0a CzS59GxXkefqTy5syN7FwLc= X-Received: by 2002:a50:a9a1:: with SMTP id n30-v6mr2853373edc.158.1538397836541; Mon, 01 Oct 2018 05:43:56 -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 h3-v6sm5278700ede.42.2018.10.01.05.43.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 05:43:55 -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 v4 2/8] mtd: maps: gpio-addr-flash: Fix ioremapped size Date: Mon, 1 Oct 2018 14:43:45 +0200 Message-Id: <20181001124351.31615-2-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181001124351.31615-1-ricardo.ribalda@gmail.com> References: <20181001124351.31615-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