Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334214
b: refs/heads/master
c: 204dd1d
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck authored and Zhang Rui committed Sep 24, 2012
1 parent 9f62551 commit d1b709b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1e426ffddf2f158367eb6c7b8eb563c814a43283
refs/heads/master: 204dd1d39c32f39a95bf7a7248f63b372fd137a6
8 changes: 4 additions & 4 deletions trunk/drivers/thermal/thermal_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ thermal_cooling_device_register(char *type, void *devdata,
struct thermal_zone_device *pos;
int result;

if (strlen(type) >= THERMAL_NAME_LENGTH)
if (type && strlen(type) >= THERMAL_NAME_LENGTH)
return ERR_PTR(-EINVAL);

if (!ops || !ops->get_max_state || !ops->get_cur_state ||
Expand All @@ -918,7 +918,7 @@ thermal_cooling_device_register(char *type, void *devdata,
return ERR_PTR(result);
}

strcpy(cdev->type, type);
strcpy(cdev->type, type ? : "");
mutex_init(&cdev->lock);
INIT_LIST_HEAD(&cdev->thermal_instances);
cdev->ops = ops;
Expand Down Expand Up @@ -1344,7 +1344,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
int count;
int passive = 0;

if (strlen(type) >= THERMAL_NAME_LENGTH)
if (type && strlen(type) >= THERMAL_NAME_LENGTH)
return ERR_PTR(-EINVAL);

if (trips > THERMAL_MAX_TRIPS || trips < 0 || mask >> trips)
Expand All @@ -1366,7 +1366,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
return ERR_PTR(result);
}

strcpy(tz->type, type);
strcpy(tz->type, type ? : "");
tz->ops = ops;
tz->device.class = &thermal_class;
tz->devdata = devdata;
Expand Down

0 comments on commit d1b709b

Please sign in to comment.