For pppoe (and one has to look at the set_item and see if delete_item is
needed).
- Arnaldo
--- linux-2.4.5-ac24/drivers/net/pppoe.c Tue Jul 3 18:45:41 2001
+++ linux-2.4.5-ac24.acme/drivers/net/pppoe.c Wed Jul 4 11:00:47 2001
@@ -567,17 +567,17 @@
if (!dev)
goto end;
+ po->pppoe_dev = dev;
+
if( ! (dev->flags & IFF_UP) )
- goto end;
+ goto err_put;
memcpy(&po->pppoe_pa,
&sp->sa_addr.pppoe,
sizeof(struct pppoe_addr));
error = set_item(po);
if (error < 0)
- goto end;
-
- po->pppoe_dev = dev;
+ goto err_put;
po->chan.hdrlen = (sizeof(struct pppoe_hdr) +
dev->hard_header_len);
@@ -586,6 +586,8 @@
po->chan.ops = &pppoe_chan_ops;
error = ppp_register_channel(&po->chan);
+ if (error)
+ goto err_put;
sk->state = PPPOX_CONNECTED;
}
@@ -595,6 +597,10 @@
end:
release_sock(sk);
return error;
+err_put:
+ dev_put(po->pppoe_dev);
+ po->pppoe_dev = NULL;
+ goto end;
}
- Arnaldo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/