Received: by 10.223.176.5 with SMTP id f5csp1003305wra; Fri, 2 Feb 2018 09:31:57 -0800 (PST) X-Google-Smtp-Source: AH8x225SY/TLBcPlJUIYRnrUVCYJt0jUWpuzOr/h949hTASRUwH4McqLrXjuaunkGfXxKkAuD4/j X-Received: by 10.98.156.143 with SMTP id u15mr40348837pfk.170.1517592717123; Fri, 02 Feb 2018 09:31:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517592717; cv=none; d=google.com; s=arc-20160816; b=DXV3Kd7VHFHOcBAoK8auMxmXD0F0w1FqC71Cml+3QSWpCw6DeSOLovdV0Tunq7K8G5 YLBCf3h8nPW4KEEfyHkhSl7w+3EoW239TgwbqjsNwJnsJbdAJZsV7K4YyZFZvbZNrD7b jNiM4Ijr+xDBVHTTsFoMVEjsc9NOAb0rwlJOUVRPnHrYACvI1vkDEwPRFaL93fabc4dj FvNN5+9E/h8Na2jjq7cwj99F+aDl+AH9PwDIYcOY76KmwAcUloQPzAaicfrsIl1nOhQy 63yAtBVz8c4YKERgW5ws8XXtxhnmwAVoHQChRmWlltA8RTE3ys8h1/ZJzy+kfb9VmIyj frCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4nroiMDPYT1kvOF3vgho7GHUWLBRi+f+pd+XPjWnO0s=; b=ltTUG2qfHIOc5L9RjEVk8/UG0H3rc8ABhK2e7c2LQa0rHevdcCGsY2P628ofItu1DC nn8Rno6eAiuS5aCI0q2rOtgKvH+ZiQmwtAXNhg6Dx8Qg2qJ+1QXB+uU3ibLvYqgHmacM 09SJ9cr/MAY067KZcXrdauU6gkr7X/+j5qYn1qs/j0hEEpNrLqlYpCcev9M88qjvP1fc H/nPovCyx6HYcO4TqkA4bx1+rP828+KGlBI53NpLpxKYmfRRy4svZckSHDMg/eI401Vg 6nLUB0ri34C+rtEipiTyYahEUsn5O4wqcbVssfZr4OZflXhOlX9JajJQ8J/JFPEmXcBv 6kGQ== ARC-Authentication-Results: i=1; mx.google.com; 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 o15si1708188pgc.48.2018.02.02.09.31.42; Fri, 02 Feb 2018 09:31:57 -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; 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 S1754095AbeBBR3Y (ORCPT + 99 others); Fri, 2 Feb 2018 12:29:24 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41204 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753123AbeBBRRX (ORCPT ); Fri, 2 Feb 2018 12:17:23 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F184ABC4; Fri, 2 Feb 2018 17:17:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lyude Paul , Dmitry Torokhov Subject: [PATCH 4.15 54/55] Input: synaptics-rmi4 - do not delete interrupt memory too early Date: Fri, 2 Feb 2018 17:59:12 +0100 Message-Id: <20180202140831.259749651@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140826.117602411@linuxfoundation.org> References: <20180202140826.117602411@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Torokhov commit a1ab69021a584d952e6548a44b93760547b1b6b5 upstream. We want to free memory reserved for interrupt mask handling only after we free functions, as function drivers might want to mask interrupts. This is needed for the followup patch to the F03 that would implement unmasking and masking interrupts from the serio pass-through port open() and close() methods. Reviewed-by: Lyude Paul Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/rmi4/rmi_driver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/drivers/input/rmi4/rmi_driver.c +++ b/drivers/input/rmi4/rmi_driver.c @@ -41,6 +41,13 @@ void rmi_free_function_list(struct rmi_d rmi_dbg(RMI_DEBUG_CORE, &rmi_dev->dev, "Freeing function list\n"); + /* Doing it in the reverse order so F01 will be removed last */ + list_for_each_entry_safe_reverse(fn, tmp, + &data->function_list, node) { + list_del(&fn->node); + rmi_unregister_function(fn); + } + devm_kfree(&rmi_dev->dev, data->irq_memory); data->irq_memory = NULL; data->irq_status = NULL; @@ -50,13 +57,6 @@ void rmi_free_function_list(struct rmi_d data->f01_container = NULL; data->f34_container = NULL; - - /* Doing it in the reverse order so F01 will be removed last */ - list_for_each_entry_safe_reverse(fn, tmp, - &data->function_list, node) { - list_del(&fn->node); - rmi_unregister_function(fn); - } } static int reset_one_function(struct rmi_function *fn)