From patchwork Wed Jan 28 15:25:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 5733651 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 505049F36E for ; Thu, 29 Jan 2015 01:36:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9A7A420149 for ; Thu, 29 Jan 2015 01:36:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB0F220219 for ; Thu, 29 Jan 2015 01:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753480AbbA2Bgs (ORCPT ); Wed, 28 Jan 2015 20:36:48 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:30397 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754202AbbA2Bgo (ORCPT ); Wed, 28 Jan 2015 20:36:44 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NIW004OY886B3C0@mailout2.samsung.com>; Thu, 29 Jan 2015 00:26:30 +0900 (KST) X-AuditID: cbfee61a-f79c06d000004e71-fe-54c8ffa6d73c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id BE.CF.20081.6AFF8C45; Thu, 29 Jan 2015 00:26:30 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NIW006PX86D1L50@mmp1.samsung.com>; Thu, 29 Jan 2015 00:26:30 +0900 (KST) From: Lukasz Majewski To: Eduardo Valentin , Dan Carpenter Cc: Zhang Rui , Linux PM list , "linux-samsung-soc@vger.kernel.org" , Bartlomiej Zolnierkiewicz , Lukasz Majewski , Kukjin Kim , Amit Daniel Kachhap , Abhilash Kesavan , Abhilash Kesavan , Kukjin Kim , Chanwoo Choi , Lukasz Majewski Subject: [PATCH] thermal: exynos: Correct sanity check at exynos_report_trigger() function Date: Wed, 28 Jan 2015 16:25:22 +0100 Message-id: <1422458722-23213-1-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGLMWRmVeSWpSXmKPExsVy+t9jAd1l/0+EGMxvNbZ4vGYxk0XD1RCL jTPWs1pc//Kc1eL1v+ksFvOvXGO1WPNXyaJ3wVU2i/7Hr5kt3jzitnjzcDOjxefeI4wWM87v Y7J48rCPzYHPY+esu+wei/e8ZPLYtKqTzWPdtLfMHh+f3mLx6NuyitHj8ya5APYoLpuU1JzM stQifbsEroy/u56xFaxkr5h1+itjA+MEti5GTg4JAROJl0deMUPYYhIX7q0HinNxCAksYpQ4 PK+dFcLpYpKYtGc1E0gVm4CexOe7T8FsEYEwibO/XzGBFDELzGWR2LtrFUsXIweHsECMxK9f fiA1LAKqEi+6ZoNt4xVwk3jStpAFYpuiRPezCWwTGLkXMDKsYhRNLUguKE5KzzXUK07MLS7N S9dLzs/dxAgOvWdSOxhXNlgcYhTgYFTi4X1hdiJEiDWxrLgy9xCjBAezkghv7z+gEG9KYmVV alF+fFFpTmrxIUZpDhYlcV4l+7YQIYH0xJLU7NTUgtQimCwTB6dUA2PHeSmn+FVZvNMUOuxq Q48ulmF2c15c1Ovs3fghzvaV4Q6hUDmO1gxFkWJp++2TbVz69eJVlF8cSDYT5nJI/tUwc29o WHfm/K4zHCzHTfPX9GTGxz64cfXPBu3MzVuvHaq/9Cwnrj3L/9y5eYL6P8UfLeJz5w50edsS nF4eE3ItxMHkb76OEktxRqKhFnNRcSIAbKK9uzkCAAA= Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Up till now, by mistake, wrong variable was tested against being NULL. Since exynos_report_trigger() is always called with valid p pointer, it is only necessary to check if a valid thermal zone device is passed. Reported-by: Dan Carpenter Signed-off-by: Lukasz Majewski --- drivers/thermal/samsung/exynos_tmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 852e622..178de03 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -172,8 +172,8 @@ static void exynos_report_trigger(struct exynos_tmu_data *p) unsigned long temp; unsigned int i; - if (!p) { - pr_err("Wrong temperature configuration data\n"); + if (!tz) { + pr_err("No thermal zone device defined\n"); return; }