Ralf Baechle <[EMAIL PROTECTED]> :
[...]
> No, with your patch the spinlock is dropped only after the
> tty->driver->write() call which might sleep.

@#$!*

Ok, try #2.


- remove duplicate code: mkiss_open() is the sole user of ax_open() and
  it has already issued spin_lock_init() when ax_open() is called;
- mkiss_open() returns err: force it to be < 0 when register_netdev()
  fails;
- missing free_netdev().

Signed-off-by: Francois Romieu <[EMAIL PROTECTED]>

diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index 3e9accf..ac25380 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -638,8 +638,6 @@ static int ax_open(struct net_device *de
 
        ax->flags   &= (1 << AXF_INUSE);      /* Clear ESCAPE & ERROR flags */
 
-       spin_lock_init(&ax->buflock);
-
        return 0;
 
 noxbuff:
@@ -764,7 +762,8 @@ static int mkiss_open(struct tty_struct 
                goto out_free_netdev;
        }
 
-       if (register_netdev(dev))
+       err = register_netdev(dev);
+       if (err < 0)    
                goto out_free_buffers;
 
        /* after register_netdev() - because else printk smashes the kernel */
@@ -836,6 +835,8 @@ static void mkiss_close(struct tty_struc
        kfree(ax->xbuff);
 
        ax->tty = NULL;
+
+       free_netdev(ax->dev);
 }
 
 /* Perform I/O control on an active ax25 channel. */
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to