Re: [KJ][PATCH] Correct misc_register return code handling in several drivers

Alan Cox
2006-10-23T17:38:46Z

Ar Llu, 2006-10-23 am 13:19 -0400, ysgrifennodd Neil Horman:
> + for_each_online_node(node) {
> + if(timers[node] != NULL)
> + kfree(timers[node]);
> + }

The if test appears to be redundant as kfree(NULL) is a valid no-op.

> + if (misc_register(&hp_sdc_rtc_dev) != 0)
> + printk(KERN_INFO "Could not register misc. dev for sdc\n");

Many users will misconstrue this has a hard disk name - is there a
better name to use.

> if (ret)
> printk(KERN_ERR "tun: Can't register misc device %d\n", TUN_MINOR);

These all really show that we should pass the name into the misc
register and do the printk there to cut down on random name variants and
kernel size. Separate problem, just noting it in case someone feels
inspired 8)

Alan