From patchwork Mon Aug 19 06:28:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 19285 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5191525AC6 for ; Mon, 19 Aug 2013 06:46:02 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id gf11sf5163973vcb.6 for ; Sun, 18 Aug 2013 23:46:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=DR1OJ52LNDws22yVWcvwmxKiveRgXaeRCG6iF/joV7Q=; b=PMODznBWSYFKugsyw4TmZTyz5VwbkVY21WsGDZGjh2AckgHwCKtzotSuShuQI1ArqE 6zBIioninPV6RZtUPVj7CJwzLJqP44pkVGfHWXktIuo7zR0dfA0fY1R283A6t+2Ub1Yh c9+iXrp9J/VZAQ7ljlaMNbw21jqcJXFyoOZVA67u5QGF46STDv0vs4TONPE46EGo8bcJ F8vgpiaes9EWgYC5QI75Vmvdr7o5nbtynylWaqJDasuD+fn4tYEINEBh8EIG5wYNcb9t D1lX2VnXVlsBdhGbVp3DBOJhNwVgarywAz3zDEdrpMNl7nJx9YbnUqrvDuGS2jbAN7ko 23kg== X-Received: by 10.236.207.103 with SMTP id m67mr3656032yho.1.1376894762035; Sun, 18 Aug 2013 23:46:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.48.49 with SMTP id i17ls1650239qen.44.gmail; Sun, 18 Aug 2013 23:46:01 -0700 (PDT) X-Received: by 10.52.120.7 with SMTP id ky7mr10026521vdb.12.1376894761893; Sun, 18 Aug 2013 23:46:01 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id vv9si2095825vec.119.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 Aug 2013 23:46:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ha12so2726307vcb.23 for ; Sun, 18 Aug 2013 23:46:01 -0700 (PDT) X-Gm-Message-State: ALoCoQlhpmqhEZNICl39HF0WrItie/5RyzpRu1XhbytyKrqCVMD3RbxK8O6zTc2Ycy4MvWy+cBIl X-Received: by 10.52.92.73 with SMTP id ck9mr4745174vdb.2.1376894761792; Sun, 18 Aug 2013 23:46:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp79802vcz; Sun, 18 Aug 2013 23:46:01 -0700 (PDT) X-Received: by 10.66.121.234 with SMTP id ln10mr11562826pab.20.1376894760806; Sun, 18 Aug 2013 23:46:00 -0700 (PDT) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by mx.google.com with ESMTPS id tl4si7483020pac.282.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 Aug 2013 23:46:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.41; Received: by mail-pa0-f41.google.com with SMTP id bj1so4264572pad.28 for ; Sun, 18 Aug 2013 23:46:00 -0700 (PDT) X-Received: by 10.66.122.67 with SMTP id lq3mr1202882pab.147.1376894760422; Sun, 18 Aug 2013 23:46:00 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id iu10sm13648506pac.18.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 Aug 2013 23:45:59 -0700 (PDT) From: Sachin Kamat To: linux-pm@vger.kernel.org Cc: jonghwa3.lee@samsung.com, eduardo.valentin@ti.com, rui.zhang@intel.com, amit.daniel@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 2/3] thermal: exynos: Fix potential NULL pointer dereference Date: Mon, 19 Aug 2013 11:58:42 +0530 Message-Id: <1376893723-22138-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1376893723-22138-1-git-send-email-sachin.kamat@linaro.org> References: <1376893723-22138-1-git-send-email-sachin.kamat@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , NULL pointer was being dereferenced in its own error message. Changed it to the correct device pointer. Signed-off-by: Sachin Kamat Acked-by: Eduardo Valentin --- drivers/thermal/samsung/exynos_thermal_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c index 4d8e444..f10a6ad 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.c +++ b/drivers/thermal/samsung/exynos_thermal_common.c @@ -53,7 +53,7 @@ static int exynos_set_mode(struct thermal_zone_device *thermal, { struct exynos_thermal_zone *th_zone = thermal->devdata; if (!th_zone) { - dev_err(th_zone->sensor_conf->dev, + dev_err(&thermal->device, "thermal zone not registered\n"); return 0; } @@ -231,7 +231,7 @@ static int exynos_get_temp(struct thermal_zone_device *thermal, void *data; if (!th_zone->sensor_conf) { - dev_err(th_zone->sensor_conf->dev, + dev_err(&thermal->device, "Temperature sensor not initialised\n"); return -EINVAL; } @@ -251,7 +251,7 @@ static int exynos_set_emul_temp(struct thermal_zone_device *thermal, struct exynos_thermal_zone *th_zone = thermal->devdata; if (!th_zone->sensor_conf) { - dev_err(th_zone->sensor_conf->dev, + dev_err(&thermal->device, "Temperature sensor not initialised\n"); return -EINVAL; }