Skip to contentSkip to conversation

net/hamradio/bpqether.c: check the return code of

KJ walter harms 1 participant 1 message Feb 9, 2006 Kernel janitors

lore
Share & tools
lore
#0 lore raw

check the return code of register_netdevice_notifier. fix for the last patch. now it removes the proc entry also.

--- linux/drivers/net/hamradio/bpqether.c.bak 2006-02-01
22:13:07.000000000 +0100
+++ linux/drivers/net/hamradio/bpqether.c 2006-02-06 22:10:24.819769200
+0100
@@ -595,6 +595,7 @@
*/
static int __init bpq_init_driver(void)
{
+ int ret;
#ifdef CONFIG_PROC_FS
if (!proc_net_fops_create("bpqether", S_IRUGO, &bpq_info_fops)) {
printk(KERN_ERR
@@ -605,7 +606,13 @@

  	dev_add_pack(&bpq_packet_type);

- register_netdevice_notifier(&bpq_dev_notifier);
+ ret = register_netdevice_notifier(&bpq_dev_notifier);
+ if (ret < 0) {
+ printk( KERN_ERR "register_netdevice_notifier failed in
%s\n",__FUNCTION__);
+ dev_remove_pack(&bpq_packet_type);
+ proc_net_remove("bpqether");
+ return -1;
+ }

  	printk(banner);

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors