scull_init_module() in scull driver

Rock Lee rocklee_104 at outlook.com
Tue Apr 7 08:14:18 EDT 2015


Hi, guys:
	I am reading function scull_init_module() in scull driver.I found that 
scull_init_module() doesn't check  scull_setup_cdev()'s return value.If 
there will be a probem when scull_setup_cdev() failed, and then, others 
call scull_cleanup_module()?

for (i = 0; i < scull_nr_devs; i++) {
	scull_devices[i].quantum = scull_quantum;
	scull_devices[i].qset = scull_qset;
	init_MUTEX(&scull_devices[i].sem);
	scull_setup_cdev(&scull_devices[i], i);
}

Best Regard
----
Rock Lee



More information about the Kernelnewbies mailing list