* [PATCH] tun - don't obscure error return from misc_register
@ 2004-03-15 18:25 Stephen Hemminger
2004-03-15 20:42 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2004-03-15 18:25 UTC (permalink / raw)
To: David S. Miller, Maxim Krasnyansky; +Cc: vtun, netdev
When Tun initialization fails it shouldn't obscure the error return,
There are several reasons it could fail, and when diagnosing user problems
the error code might provide more info.
diff -Nru a/drivers/net/tun.c b/drivers/net/tun.c
--- a/drivers/net/tun.c Mon Mar 15 10:13:37 2004
+++ b/drivers/net/tun.c Mon Mar 15 10:13:37 2004
@@ -609,15 +609,15 @@
int __init tun_init(void)
{
+ int ret = 0;
+
printk(KERN_INFO "Universal TUN/TAP device driver %s "
"(C)1999-2002 Maxim Krasnyansky\n", TUN_VER);
- if (misc_register(&tun_miscdev)) {
+ ret = misc_register(&tun_miscdev);
+ if (ret)
printk(KERN_ERR "tun: Can't register misc device %d\n", TUN_MINOR);
- return -EIO;
- }
-
- return 0;
+ return ret;
}
void tun_cleanup(void)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] tun - don't obscure error return from misc_register
2004-03-15 18:25 [PATCH] tun - don't obscure error return from misc_register Stephen Hemminger
@ 2004-03-15 20:42 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-03-15 20:42 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: maxk, vtun, netdev
On Mon, 15 Mar 2004 10:25:39 -0800
Stephen Hemminger <shemminger@osdl.org> wrote:
> When Tun initialization fails it shouldn't obscure the error return,
> There are several reasons it could fail, and when diagnosing user problems
> the error code might provide more info.
Applied, thanks Stephen.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-15 20:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-15 18:25 [PATCH] tun - don't obscure error return from misc_register Stephen Hemminger
2004-03-15 20:42 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).