Received: by 10.223.176.5 with SMTP id f5csp994850wra; Fri, 2 Feb 2018 09:24:39 -0800 (PST) X-Google-Smtp-Source: AH8x227iVn7yU1LHmCH0iNsnTGo8vg8TXZfkxtBGkhXzz4mCcLT+gZ4mZzUIJPKKSywk7C0V3d9/ X-Received: by 2002:a17:902:595d:: with SMTP id e29-v6mr36380953plj.436.1517592279138; Fri, 02 Feb 2018 09:24:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517592279; cv=none; d=google.com; s=arc-20160816; b=GMzk9aAi/wxh9nbH89Tw8g6x8DiHyXc/74FK15+1SHPgDbBGEfCkaM5pADwhn/hpFR gfeOcJvI0MkPctQBhoGYuWeH8b0AdTBTC2Lf2qFxjyID3fTzpQHtBFAwvSRZZ+y/6kSV oqcHa9bkmBUZhnQLlsBElNEDY0YznRLdCm9ZHOE7WbSURVwjvuQQE/0O6e5yh+YJtgwy J2TBJbo10uy/wZTijWcINerdm6GYx4cb7Mp3UiyZlj3l4BTVN2DGMTB74GzjpUXc2h0f kEjwfvKlCtx+s8SBWZ2keylQ4MaNFhOkMhfIx4gMgysufSFaBQnpNHIoPuBnLQpLmmmh wOjQ== 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=VeACQyFRbJQrbEz5WGuznKxfSIWGR0pGHp/h9qaHu8g=; b=CDjy50dUkKSpZpAIhVbm/xiJEnY/mXpcsFs0V16LFFKl9Ffvv3HGrPGsxcJ3Sc5OCB Q9Hkznxoa6ck8fXBAHk5GhjI/1gTrcI5kMJwHhbjpviHu8SHZnx2zNqtnOLH0U8KSwcC 8meqXGgWqFDUUh7VDdfOqq03zC7JgRU7k7G32d3VjGTbAnbRkuIloRihyA1sCyUeIOHj LgK/3w2kuBWXC9fFPMxzYmM7iNsN8ExGf4NUB6aANENgqRvvjZ6XZ89O4PG31gCpLTAp yONlWuIvrm4XCmGgzojqDOZDpFokrEtcAEboadt4Gf+E+8IsXTywi9g0HikiB2HNjGc5 8wnw== 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 i6-v6si91836plr.802.2018.02.02.09.24.24; Fri, 02 Feb 2018 09:24: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; 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 S1753862AbeBBRWk (ORCPT + 99 others); Fri, 2 Feb 2018 12:22:40 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:40402 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753095AbeBBROP (ORCPT ); Fri, 2 Feb 2018 12:14:15 -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 42649C1C; Fri, 2 Feb 2018 17:14:15 +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.14 155/156] Input: synaptics-rmi4 - do not delete interrupt memory too early Date: Fri, 2 Feb 2018 17:58:56 +0100 Message-Id: <20180202140847.413943696@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@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.14-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)