Commit 4748f96
thermal: core: fix some possible name leaks in error paths
In some error paths before device_register(), the names allocated
by dev_set_name() are not freed. Move dev_set_name() front to
device_register(), so the name can be freed while calling
put_device().
Fixes: 1dd7128 ("thermal/core: Fix null pointer dereference in thermal_release()")
Signed-off-by: Yang Yingliang <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>1 parent b778b4d commit 4748f96
1 file changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | 897 | | |
902 | 898 | | |
903 | 899 | | |
| |||
917 | 913 | | |
918 | 914 | | |
919 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
920 | 921 | | |
921 | 922 | | |
922 | 923 | | |
| |||
1250 | 1251 | | |
1251 | 1252 | | |
1252 | 1253 | | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | 1254 | | |
1258 | 1255 | | |
1259 | 1256 | | |
| |||
1276 | 1273 | | |
1277 | 1274 | | |
1278 | 1275 | | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
1279 | 1281 | | |
1280 | 1282 | | |
1281 | 1283 | | |
| |||
0 commit comments