From patchwork Thu Apr 7 08:36:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 65243 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp335437lbc; Thu, 7 Apr 2016 01:37:19 -0700 (PDT) X-Received: by 10.66.62.232 with SMTP id b8mr3067229pas.104.1460018239339; Thu, 07 Apr 2016 01:37:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yj6si10305538pab.164.2016.04.07.01.37.19; Thu, 07 Apr 2016 01:37:19 -0700 (PDT) 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=@linaro.org; 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; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755450AbcDGIhM (ORCPT + 29 others); Thu, 7 Apr 2016 04:37:12 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35756 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755424AbcDGIhJ (ORCPT ); Thu, 7 Apr 2016 04:37:09 -0400 Received: by mail-pa0-f44.google.com with SMTP id td3so50838687pab.2 for ; Thu, 07 Apr 2016 01:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=pVlTr+HoA6qkGPYnUpccyZUfzJ2hpI6Mddc3o3AyV1Y=; b=CHuT3QhfYBrCwzBcl0lKUv2jYBfM6ikVe67iOupRssoOhd+qelC4vNzo+tesMv+ogf 38MwiwZaLiN2fzZ8/sLMhRPzUV8lPOTHBbD8cAM+aESdBknKRCetzTIKYQfI3w+rbZql 6WKAGqKeIhTJz7sNQVvNN/F7aXv15ONdnhUWQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=pVlTr+HoA6qkGPYnUpccyZUfzJ2hpI6Mddc3o3AyV1Y=; b=EweTG0iDJLnuvKGCjmLD1Kjp+rqfRFm+GErN9WcDFeQH/kjLVVZDcZWt1z528VFFOF e9NB1CBYXt9rVgi9TYVzziC09pIMt5OoDZRpHXhegSDsmUMPp2wTIf/hN+XW33FUAgn8 94b6SbG0t/fq8bbUjMMvzlwDpDMByrT5q9boB0LKZW8vcgwn8yWazEVrMerrNKEHyu3Y X8MQ8QhxpbQvBmRldkIXjwHMlI24Hq/5xpH97KyGxGj+M1iAw2xA73cU39fBSIqEvjTW hR88clASxgyfplvtbmCmdQmFAl4vQe4bOfZOkwNoC8Z6FAAKRVNoV8hFjFDetjDx7JNO /n9g== X-Gm-Message-State: AD7BkJJ/9Cz1oVhmiab0rIut1nMAsRU7YGAqOEPrk2LVmwu86CHkAuwBCfpqfMaVg5SHE11f X-Received: by 10.66.102.106 with SMTP id fn10mr3157909pab.60.1460018228616; Thu, 07 Apr 2016 01:37:08 -0700 (PDT) Received: from localhost ([122.171.65.211]) by smtp.gmail.com with ESMTPSA id yl1sm10226409pac.35.2016.04.07.01.37.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Apr 2016 01:37:07 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V1 Resend 2/2] cpufreq: acpi: policy->driver_data can't be NULL in ->exit() Date: Thu, 7 Apr 2016 14:06:58 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: <31560235fc686a26bb5d975059d480fd9e645b17.1460018171.git.viresh.kumar@linaro.org> References: <31560235fc686a26bb5d975059d480fd9e645b17.1460018171.git.viresh.kumar@linaro.org> In-Reply-To: <31560235fc686a26bb5d975059d480fd9e645b17.1460018171.git.viresh.kumar@linaro.org> References: <31560235fc686a26bb5d975059d480fd9e645b17.1460018171.git.viresh.kumar@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Its always set by ->init() and so it will always be there in ->exit(). There is no need to have a special check for just that. Signed-off-by: Viresh Kumar --- drivers/cpufreq/acpi-cpufreq.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.7.1.410.g6faf27b diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 4fe67775555a..74182209bab7 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -887,14 +887,12 @@ static int acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy) pr_debug("acpi_cpufreq_cpu_exit\n"); - if (data) { - policy->fast_switch_possible = false; - policy->driver_data = NULL; - acpi_processor_unregister_performance(data->acpi_perf_cpu); - free_cpumask_var(data->freqdomain_cpus); - kfree(policy->freq_table); - kfree(data); - } + policy->fast_switch_possible = false; + policy->driver_data = NULL; + acpi_processor_unregister_performance(data->acpi_perf_cpu); + free_cpumask_var(data->freqdomain_cpus); + kfree(policy->freq_table); + kfree(data); return 0; }