
< void thermal_debug_cdev_remove(struct thermal_cooling_device *cdev)
< {
< 	struct thermal_debugfs *thermal_dbg = cdev->debugfs;
---
> #define SAFE_ACCESS(ptr, member) ((ptr) ? (ptr)->member : NULL)
> 
> void thermal_debug_cdev_remove(struct thermal_cooling_device *cdev)
> {
> 	struct thermal_debugfs *thermal_dbg = SAFE_ACCESS(cdev, debugfs);
