From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754743AbcITO45 (ORCPT ); Tue, 20 Sep 2016 10:56:57 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:59675 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753240AbcITO4z (ORCPT ); Tue, 20 Sep 2016 10:56:55 -0400 Date: Tue, 20 Sep 2016 16:56:28 +0200 From: Sebastian Andrzej Siewior To: peterz@infradead.org, rjw@rjwysocki.net, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de Cc: Borislav Petkov Subject: [PATCH] cpufreq: fix up conversion to hotplug state machine Message-ID: <20160920145628.lp2bmq72ip3oiash@linutronix.de> References: <20160906170457.32393-13-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20160910 (1.7.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function cpufreq_register_driver() returns zero on success and since commit 27622b061eb4 ("cpufreq: Convert to hotplug state machine") erroneously a positive number. Due to the "if (x) assume_error" construct all callers assumed an error and things went south. This patch resets the return value back to zero in the success case. Fixes: 27622b061eb4 ("cpufreq: Convert to hotplug state machine") Reported-by: Borislav Petkov Signed-off-by: Sebastian Andrzej Siewior --- drivers/cpufreq/cpufreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index e0bc632a259e..8b44de4d7438 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2503,6 +2503,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) if (ret < 0) goto err_if_unreg; hp_online = ret; + ret = 0; pr_debug("driver %s up and running\n", driver_data->name); goto out; -- 2.9.3