aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/thermal_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/thermal_sys.c')
-rw-r--r--drivers/thermal/thermal_sys.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 36e6f4d4ec3b..47498b871903 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -901,7 +901,7 @@ thermal_cooling_device_register(char *type, void *devdata,
901 struct thermal_zone_device *pos; 901 struct thermal_zone_device *pos;
902 int result; 902 int result;
903 903
904 if (strlen(type) >= THERMAL_NAME_LENGTH) 904 if (type && strlen(type) >= THERMAL_NAME_LENGTH)
905 return ERR_PTR(-EINVAL); 905 return ERR_PTR(-EINVAL);
906 906
907 if (!ops || !ops->get_max_state || !ops->get_cur_state || 907 if (!ops || !ops->get_max_state || !ops->get_cur_state ||
@@ -918,7 +918,7 @@ thermal_cooling_device_register(char *type, void *devdata,
918 return ERR_PTR(result); 918 return ERR_PTR(result);
919 } 919 }
920 920
921 strcpy(cdev->type, type); 921 strcpy(cdev->type, type ? : "");
922 mutex_init(&cdev->lock); 922 mutex_init(&cdev->lock);
923 INIT_LIST_HEAD(&cdev->thermal_instances); 923 INIT_LIST_HEAD(&cdev->thermal_instances);
924 cdev->ops = ops; 924 cdev->ops = ops;
@@ -1344,7 +1344,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
1344 int count; 1344 int count;
1345 int passive = 0; 1345 int passive = 0;
1346 1346
1347 if (strlen(type) >= THERMAL_NAME_LENGTH) 1347 if (type && strlen(type) >= THERMAL_NAME_LENGTH)
1348 return ERR_PTR(-EINVAL); 1348 return ERR_PTR(-EINVAL);
1349 1349
1350 if (trips > THERMAL_MAX_TRIPS || trips < 0 || mask >> trips) 1350 if (trips > THERMAL_MAX_TRIPS || trips < 0 || mask >> trips)
@@ -1366,7 +1366,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
1366 return ERR_PTR(result); 1366 return ERR_PTR(result);
1367 } 1367 }
1368 1368
1369 strcpy(tz->type, type); 1369 strcpy(tz->type, type ? : "");
1370 tz->ops = ops; 1370 tz->ops = ops;
1371 tz->device.class = &thermal_class; 1371 tz->device.class = &thermal_class;
1372 tz->devdata = devdata; 1372 tz->devdata = devdata;