diff
<     struct thermal_debugfs *thermal_dbg = cdev->debugfs;
---
>     struct thermal_debugfs *thermal_dbg;
>     if (!cdev) return -EINVAL;
>     thermal_dbg = cdev->debugfs;
