The patch titled dtlk: fix error checks in module_init() has been removed from the -mm tree. Its filename was dtlk-fix-error-checks-in-module_init.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: dtlk: fix error checks in module_init() From: Akinobu Mita <akinobu.mita@xxxxxxxxx> This patch fixes two things in module_init. - fix register_chrdev() error check Currently dtlk doesn't check register_chrdev() failure correctly. register_chrdev() returns a errno on failure. - check probe failure dtlk ignores probe failure and allows the module loading without such device. I got "Trying to free nonexistent resource" message by release_region() when unloading module without device. [akpm@xxxxxxxxxxxxxxxxxxxx: fix error code return] Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx> Cc: Chris Pallotta <chris@xxxxxxxxxxxx> Cc: Jim Van Zandt <jrv@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/char/dtlk.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff -puN drivers/char/dtlk.c~dtlk-fix-error-checks-in-module_init drivers/char/dtlk.c --- a/drivers/char/dtlk.c~dtlk-fix-error-checks-in-module_init +++ a/drivers/char/dtlk.c @@ -324,16 +324,22 @@ static int dtlk_release(struct inode *in static int __init dtlk_init(void) { + int err; + dtlk_port_lpc = 0; dtlk_port_tts = 0; dtlk_busy = 0; dtlk_major = register_chrdev(0, "dtlk", &dtlk_fops); - if (dtlk_major == 0) { + if (dtlk_major < 0) { printk(KERN_ERR "DoubleTalk PC - cannot register device\n"); - return 0; + return dtlk_major; + } + err = dtlk_dev_probe(); + if (err) { + unregister_chrdev(dtlk_major, "dtlk"); + return err; } - if (dtlk_dev_probe() == 0) - printk(", MAJOR %d\n", dtlk_major); + printk(", MAJOR %d\n", dtlk_major); init_waitqueue_head(&dtlk_process_list); _ Patches currently in -mm which might be from akinobu.mita@xxxxxxxxx are origin.patch git-alsa.patch auth_gss-unregister-gss_domain-when-unloading-module.patch fault-injection-disable-stacktrace-filter-for-x86-64.patch cm4000_cs-fix-error-paths.patch cm4000_cs-use-bitrev.patch use-simple_read_from_buffer-in-fs.patch use-simple_read_from_buffer-in-kernel.patch sunrpc-fix-error-path-in-module_init.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html