linux - Kernel crashes when doing thermal_zone_device_unregister() -
i trying install dummy thermal zone device in sys/class/thermal using kernel module. doing insmod register device works perfectly..
struct thermal_zone_device *tz_dev; //declared globally... ... //in init function tz_dev = thermal_zone_device_register("tsensor", 2,null,&tsensor_ops, 0,0, 0,0);
where tsensor_ops points struct thermal_zone_device_ops bunch of dummy callback functions.
however, when rmmod following code,
thermal_zone_device_unregister(tz_dev);
i message saying killed! reply , dmesg gives me error null pointers. way me recover reboot machine. there way avoid this?
ok fixed it. specific version of linux, thermal_sys framework requires have function declared get_crit_temp. if don't define this, try remove device file upon unregistering device , end null reference error. note not apply linux versions above 3.0
Comments
Post a Comment