From b0fe9249734f834b501be12a31de45a740f6bc0e Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Thu, 27 Sep 2012 16:48:28 -0700 Subject: [PATCH] --- yaml --- r: 339272 b: refs/heads/master c: 791700cdfc2453eb927ff7875d183d9808d89bfb h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/thermal/thermal_sys.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index f01b6e002805..735e77f09762 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a56757af8e7d7d8bfb6317c25b6a8809abfceb9a +refs/heads/master: 791700cdfc2453eb927ff7875d183d9808d89bfb diff --git a/trunk/drivers/thermal/thermal_sys.c b/trunk/drivers/thermal/thermal_sys.c index a69f24c4414a..8f0f37bb2825 100644 --- a/trunk/drivers/thermal/thermal_sys.c +++ b/trunk/drivers/thermal/thermal_sys.c @@ -252,8 +252,8 @@ static void bind_cdev(struct thermal_cooling_device *cdev) } tzp = pos->tzp; - if (!tzp->tbp) - return; + if (!tzp || !tzp->tbp) + continue; for (i = 0; i < tzp->num_tbps; i++) { if (tzp->tbp[i].cdev || !tzp->tbp[i].match) @@ -289,7 +289,7 @@ static void bind_tz(struct thermal_zone_device *tz) goto exit; } - if (!tzp->tbp) + if (!tzp || !tzp->tbp) goto exit; list_for_each_entry(pos, &thermal_cdev_list, node) { @@ -387,12 +387,13 @@ static void update_temperature(struct thermal_zone_device *tz) ret = tz->ops->get_temp(tz, &temp); if (ret) { pr_warn("failed to read out thermal zone %d\n", tz->id); - return; + goto exit; } tz->last_temperature = tz->temperature; tz->temperature = temp; +exit: mutex_unlock(&tz->lock); }