thermal: Fix potential NULL pointer accesses
The type parameter in thermal_zone_device_register and thermal_cooling_device_register can be NULL, indicating that no sysfs attribute for the type should be created. Only call strlen() and strcpy() on type if it is not NULL. This patch addresses Coverity #102180 and #102182: Dereference before null check Signed-off-by: NGuenter Roeck <linux@roeck-us.net> Signed-off-by: NZhang Rui <rui.zhang@intel.com>
Showing
想要评论请 注册 或 登录