Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp484398ybl; Tue, 28 Jan 2020 06:40:54 -0800 (PST) X-Google-Smtp-Source: APXvYqz1cxEhaTXOsLaxNSCzRVlPLoA1dhcKDbXJwuOqOzD0znVieQYSfQ0a9WsEqHEA8V4jJTYk X-Received: by 2002:a9d:2264:: with SMTP id o91mr16581901ota.328.1580222454735; Tue, 28 Jan 2020 06:40:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580222454; cv=none; d=google.com; s=arc-20160816; b=oLe15S7CacB99ioWNhrv6iv2XNpLCFAR5YZPZIJe1BvjOU26hQvzXcywTh4kKAXJkq ulKvu5vYWLVhcA6t2IC10vpK8iWG9T6FxowZcEhWOh+uSSHEFzIxpWIF9dHneckHBP4V n8FnEgU45b0oxayWM19xxa3LcN/NJ7BTctX0NEi3q1ELrs7K/lP5bJHouw1iQe0tCXSN 4JRKe/P+SGoaEJPOoWcBGc5Wydyh2fWJNqNX00NvSCXGf6bqNnBgZNsYUyA2LOZUXIPG 81vMMUu4jk+1mCAfIzRNH0o8sJ9AXNCYwuaYjQDFzRCzvbd78edu41W9jYhZsa3y0CiT cZFg== 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=7Us2Kf6YzdBfscogkG15STAU7QBJhDnlQOkqfHc7Hw8=; b=0vZKJktT7Xb9o1SSSeFYeGDX/yNNWSyW8hwO3UxRIrl09X5Mv1fEzj8eC5EEsxBFNo XXS6RL0KNqjMAUlImFaqVmBcS9FXoQHmprDoLKafb5Sj+LBLd3PkilhnKHVVkvBah+wN Y24V4dclJJ9x7omvqzdSnATZBZnv17scMCUqZwC3cJOgHD47lgZwQGJaufzHtKgHd1UO ulbcFUkF8AFOJX9pr+rl2+N/ZmQVrh/4WpGcHG8s3EP+ZVu5BprAZZp+ejDUcTAmieCA 7uNJFB5fBwmBIqHG2/znuqnvWv+Ye1ppgrtP/0cwv1w2u8XrlwwXXXV4VgjEnjf28AtT s4wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZE1PuOsQ; 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 o7si8767470otk.185.2020.01.28.06.40.42; Tue, 28 Jan 2020 06:40: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=ZE1PuOsQ; 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 S1730446AbgA1OSX (ORCPT + 99 others); Tue, 28 Jan 2020 09:18:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:42282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730216AbgA1OSU (ORCPT ); Tue, 28 Jan 2020 09:18:20 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 089EB21739; Tue, 28 Jan 2020 14:18:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221099; bh=hb8uCsAeKE7VQ83JGYoEkrhamX93zZtVbVIqc9iO4qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZE1PuOsQptPiXHdaKlaMB7jpwh2oyBFMEiX/16vDAPRriJZ8zaZX9aYT2GRaaPymb aCIhgzNHhZEbib3pQ6imsgtboPKqWViTgFDm9EAYMC0tdEDt5Lxg0t8NO78ImubPGC Nod2Pc9TUSoUGTyDmFfwwR5hn/ToielrfnRJl+o4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Marek Szyprowski , Chanwoo Choi , Daniel Lezcano , Sasha Levin Subject: [PATCH 4.9 088/271] clocksource/drivers/exynos_mct: Fix error path in timer resources initialization Date: Tue, 28 Jan 2020 15:03:57 +0100 Message-Id: <20200128135859.136775624@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Marek Szyprowski [ Upstream commit b9307420196009cdf18bad55e762ac49fb9a80f4 ] While freeing interrupt handlers in error path, don't assume that all requested interrupts are per-processor interrupts and properly release standard interrupts too. Reported-by: Krzysztof Kozlowski Fixes: 56a94f13919c ("clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier") Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi Signed-off-by: Daniel Lezcano Signed-off-by: Sasha Levin --- drivers/clocksource/exynos_mct.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index d32248e2ceab4..ae3cbaeffd9c5 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -563,7 +563,19 @@ static int __init exynos4_timer_resources(struct device_node *np, void __iomem * return 0; out_irq: - free_percpu_irq(mct_irqs[MCT_L0_IRQ], &percpu_mct_tick); + if (mct_int_type == MCT_INT_PPI) { + free_percpu_irq(mct_irqs[MCT_L0_IRQ], &percpu_mct_tick); + } else { + for_each_possible_cpu(cpu) { + struct mct_clock_event_device *pcpu_mevt = + per_cpu_ptr(&percpu_mct_tick, cpu); + + if (pcpu_mevt->evt.irq != -1) { + free_irq(pcpu_mevt->evt.irq, pcpu_mevt); + pcpu_mevt->evt.irq = -1; + } + } + } return err; } -- 2.20.1