summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/ti-soc-thermal
diff options
context:
space:
mode:
authorRickard Strandqvist2014-06-02 23:25:30 +0200
committerZhang Rui2014-07-01 03:52:35 +0200
commitfbe2ddcdcca9c15558533cb75e5161152338b548 (patch)
tree7a17272d8daf819fa1288e9995dd804d8af5d673 /drivers/thermal/ti-soc-thermal
parentThermal: imx: correct critical trip temperature setting (diff)
downloadkernel-qcow2-linux-fbe2ddcdcca9c15558533cb75e5161152338b548.tar.gz
kernel-qcow2-linux-fbe2ddcdcca9c15558533cb75e5161152338b548.tar.xz
kernel-qcow2-linux-fbe2ddcdcca9c15558533cb75e5161152338b548.zip
thermal: ti-soc-thermal: ti-bandgap.c: Cleaning up wrong address is checked
Wrong address is checked after memory allocation. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/ti-soc-thermal')
-rw-r--r--drivers/thermal/ti-soc-thermal/ti-bandgap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index a1271b55103a..634b6ce0e63a 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -1155,7 +1155,7 @@ static struct ti_bandgap *ti_bandgap_build(struct platform_device *pdev)
/* register shadow for context save and restore */
bgp->regval = devm_kzalloc(&pdev->dev, sizeof(*bgp->regval) *
bgp->conf->sensor_count, GFP_KERNEL);
- if (!bgp) {
+ if (!bgp->regval) {
dev_err(&pdev->dev, "Unable to allocate mem for driver ref\n");
return ERR_PTR(-ENOMEM);
}