Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp796999imu; Tue, 11 Dec 2018 07:44:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/XQVo1FLEYC6Ove26px8Nx+oh8uJ9BznoIrMfiA7x0J0kCatVzrmgFlLOWecyVASN5uUC9o X-Received: by 2002:a17:902:2a0a:: with SMTP id i10mr16150872plb.323.1544543079949; Tue, 11 Dec 2018 07:44:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544543079; cv=none; d=google.com; s=arc-20160816; b=Y54I6BJA80jtwnF4tX/Zc8FdKjNWIrFWuRa5iw1CcrzHQhwwKbpAIVDw83F9594i+L lYGcrZHBtQelech+NcbjowaNYMK2fKbAbKktqnqiuPhjAXleiI60wyvkHS8wXH0buJv0 yoVrVnlj944cw4VAhuhBBXTKQ8U+CL0ofaas3KA3V7TyIjo2fHIYnMS0gSvZQ39k8Jng uYEjrl7NrzN3AgVXAd5dK2m2Q2fVkfV7wkXPx2UlrjZGtI7H4rzAs1t9zRYiPrgrWLOo 2tmtyvm9TO693B2RV5Q8jjr7IUmwLBZq+yd+uYskwAJojZvh2nkILYQwA9zcUtPH/vgi M81A== 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=alZuhe+uYFR8hd/8Tlx9zoh1IcmQxCe0ysunMRTpM+g=; b=M46YSmy86ANlGVIL2T96Ju6H6dkDO64v9RbuyWH0+CPPscprXREkWEa0ySnyHH+9BS O8sXDmRV9saTV5yQ/BUQ+KzmNzf18cZbRZ1ZlTSW2/A4juGVmg0+W3KOjAmIwqWGn2Kw zwILBvNN7O8ZQP6DwPZ3I/1LJ0NrMGc61+k5i0vqJ8k5PCCA+Wdlhs0665X1SQQbVIo4 cURUREj3YJih5TEpwFUGrpun0zAaB2yz6Bcnq2/QuTEJjLbDrvVCSxXeN/yT+0v+2wHj JFI2+u/ncHenEjVuZnTDoSSIjHQCJ2oHWi5806+VHPuQW92R5hhM+mwUf0xTZTR9vVJ6 WSyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XG0aqBBW; 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 a16si12492004plm.365.2018.12.11.07.44.24; Tue, 11 Dec 2018 07:44:39 -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=XG0aqBBW; 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 S1727455AbeLKPnM (ORCPT + 99 others); Tue, 11 Dec 2018 10:43:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:59592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726919AbeLKPnK (ORCPT ); Tue, 11 Dec 2018 10:43:10 -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 69A7F2087F; Tue, 11 Dec 2018 15:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544542989; bh=l39nIUf8k/xg5kIf9TYpw7uppwqxSlBJVTVK/yyenDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XG0aqBBWlFHoAPUSLnD0ohshIfxh6mfPjsD3kCRtiDFI9m0MAxs+Ky8nH28Y3oWsR j+L8XuJi3d4yCYvECipvLuPHupt3GQlovmSX8CDDp2coi2DWr7IqWxMlgzk+jAHUrx Mqwb/S8AhLKMEnPOKfM9J+3rCE49IbrUeIa3mGds= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sam Bobroff , Dave Airlie Subject: [PATCH 3.18 25/54] drm/ast: Fix incorrect free on ioregs Date: Tue, 11 Dec 2018 16:41:13 +0100 Message-Id: <20181211151547.395287428@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151546.010073210@linuxfoundation.org> References: <20181211151546.010073210@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 3.18-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 @@ -489,7 +489,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;