Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp839944imu; Tue, 11 Dec 2018 08:20:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/XizhtSPrSfX96uL44da17nOOwiYYFkGN+iZDPmwe19OKsXrlxBeuV8fXIDB2QA7wjw15AL X-Received: by 2002:a17:902:6a4:: with SMTP id 33mr16161302plh.99.1544545254644; Tue, 11 Dec 2018 08:20:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544545254; cv=none; d=google.com; s=arc-20160816; b=jHMe46SaSJPcJgwFnEMNcZkQBZxhmUdbjqrn6EC14wzZnkn2o6RuyK9WcThJxRq36B uh+qxl2T0WhyLJB8H65QgIxuqaqLDtybA5kCA/jVGwUx1P5/KxRD8tsNS1mvKBUaU6m5 L98iAHmYGpW1yqF6p0GyTAvAIBcD7BmLZTWD6LKm9UoGVG1Ukombis68WYzQWwA67dby REepEDcO255Xvre91UYZWhLZ3NzhASfCT+idPRmkA6s6oK6r/P365acS4wud19X5RBnx pWWFOMbS56akajaFlNPHQLqhIxVYetKzTnLvTcTVYd7bhS1CX8yUagSOzYvXFXGlf9Tn GKCA== 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:dkim-signature; bh=ViArEpsfwb6e7B/1zSkq1q9Zm7imixD7Sok+z0iZT/I=; b=A3Bjsum9DPpBnkY52lNYMrZcTvAYBEWInhH+5virGCc/40xp2PYdTVH1UQHWumrkrX oxLthoCePzwWIq0C0wN3OgB/6tgo1ep11OLlDFoJsypfxjcvuCjagzIWWrm202n50ZCL 26HXo45wTr1L0zbrZ8CP4KYMOP9bwpu2Hib5GXJSNot7CqeZNFsvMLrmo8zaEhELE/HG +Fw+FAm8zcSvCHm7SbY7FesC0jRLwOMtJass18cMOY6vGpQINfQBCsukuhicob0AZU9g I69MV+HmWRakDulN8K6Wj0AK7LlS/FOVNCMazsU93vqDyQJB8fm+zjtrKV7BsEGuCeWs T3yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sN10GaSM; 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 b24si11895069pgi.308.2018.12.11.08.20.40; Tue, 11 Dec 2018 08:20:54 -0800 (PST) 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=@kernel.org header.s=default header.b=sN10GaSM; 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 S1728265AbeLKPqF (ORCPT + 99 others); Tue, 11 Dec 2018 10:46:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:34484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728199AbeLKPqE (ORCPT ); Tue, 11 Dec 2018 10:46:04 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A1F720870; Tue, 11 Dec 2018 15:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543163; bh=nHcHy5LtX49/uXZZVqJZwWzEuUOv75DCzDz0kT4loBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sN10GaSMKGkPlRnKXj+7Dh/oKmyRCBV9dibXGDbq5YOVouLteV6N3Al+wQQEOgA2d KJ9z+tdlRSTvag/f0OdEJ1DLfix1aHssz6AW0NiBl16cJeYnMMfG1GSFKOaqHE/5+n 6TW1gFS8F43QVWKvDd4WvT/xwn2TihbegCALGEto= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sam Bobroff , Dave Airlie Subject: [PATCH 4.4 36/91] drm/ast: Fix incorrect free on ioregs Date: Tue, 11 Dec 2018 16:40:55 +0100 Message-Id: <20181211151608.743958558@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151606.026852373@linuxfoundation.org> References: <20181211151606.026852373@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sam Bobroff commit dc25ab067645eabd037f1a23d49a666f9e0b8c68 upstream. If the platform has no IO space, ioregs is placed next to the already allocated regs. In this case, it should not be separately freed. This prevents a kernel warning from __vunmap "Trying to vfree() nonexistent vm area" when unloading the driver. Fixes: 0dd68309b9c5 ("drm/ast: Try to use MMIO registers when PIO isn't supported") Signed-off-by: Sam Bobroff Cc: Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/ast/ast_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -557,7 +557,8 @@ int ast_driver_unload(struct drm_device drm_mode_config_cleanup(dev); ast_mm_fini(ast); - pci_iounmap(dev->pdev, ast->ioregs); + if (ast->ioregs != ast->regs + AST_IO_MM_OFFSET) + pci_iounmap(dev->pdev, ast->ioregs); pci_iounmap(dev->pdev, ast->regs); kfree(ast); return 0;