From patchwork Fri Oct 25 13:52:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3095841 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1B2AEBF924 for ; Fri, 25 Oct 2013 13:52:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 600A520334 for ; Fri, 25 Oct 2013 13:52:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8EA8020136 for ; Fri, 25 Oct 2013 13:52:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753778Ab3JYNwS (ORCPT ); Fri, 25 Oct 2013 09:52:18 -0400 Received: from mail-ee0-f48.google.com ([74.125.83.48]:64404 "EHLO mail-ee0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753949Ab3JYNwS (ORCPT ); Fri, 25 Oct 2013 09:52:18 -0400 Received: by mail-ee0-f48.google.com with SMTP id e50so1973318eek.35 for ; Fri, 25 Oct 2013 06:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=5mX+JmRN7CUpujN7pq7jPjACcmKOU9yONvh/HVW5Xug=; b=NRiy/OJriTVs4aUJUWPn5NCarjUqwbhMlNuy3To/tUZ2Dkp2DhowqaI+JKHf/ohEbR L5kfOoNR8QJaz+twa08Jey6z7BlPgcszvscYftbqxvd+pQjYVABBqg3cn0HWpa5BMEZn /hRRMDTENtgJ0PdKR7io2jhxNlFddI5FlD/80U1coev2PtgDn0C7e9RWNYJyMfHMxa/m IXKqBCrTG/U4XkXG1ww3gjQ++13RYAgPhYdbxOlZIpHG8K7699BHmva9HefhIydKtgpE 6baaJe4wTcqkXwGkni6MrFZ88r5R+MgLDMSF4HlY02fFl7JcjCxmZmo5rmkCJQFkaWvT zM6Q== MIME-Version: 1.0 X-Received: by 10.204.123.199 with SMTP id q7mr3492245bkr.10.1382709136984; Fri, 25 Oct 2013 06:52:16 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Fri, 25 Oct 2013 06:52:16 -0700 (PDT) Date: Fri, 25 Oct 2013 21:52:16 +0800 Message-ID: Subject: [PATCH] devfreq: fix return value check in devfreq_init() From: Wei Yongjun To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com Cc: yongjun_wei@trendmicro.com.cn, linux-pm@vger.kernel.org Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function create_freezable_workqueue() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun --- drivers/devfreq/devfreq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index c99c00d..22e5d2f 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -993,10 +993,10 @@ static int __init devfreq_init(void) } devfreq_wq = create_freezable_workqueue("devfreq_wq"); - if (IS_ERR(devfreq_wq)) { + if (!devfreq_wq) { class_destroy(devfreq_class); pr_err("%s: couldn't create workqueue\n", __FILE__); - return PTR_ERR(devfreq_wq); + return -ENOMEM; } devfreq_class->dev_groups = devfreq_groups;