- Update to 2.6.25-rc3.
[linux-flexiantxendom0-3.2.10.git] / drivers / net / hamradio / mkiss.c
index 803a3bd..30c9b3b 100644 (file)
@@ -289,7 +289,6 @@ static void ax_bump(struct mkiss *ax)
                        *ax->rbuff &= ~0x20;
                }
        }
-       spin_unlock_bh(&ax->buflock);
 
        count = ax->rcount;
 
@@ -297,17 +296,17 @@ static void ax_bump(struct mkiss *ax)
                printk(KERN_ERR "mkiss: %s: memory squeeze, dropping packet.\n",
                       ax->dev->name);
                ax->stats.rx_dropped++;
+               spin_unlock_bh(&ax->buflock);
                return;
        }
 
-       spin_lock_bh(&ax->buflock);
        memcpy(skb_put(skb,count), ax->rbuff, count);
-       spin_unlock_bh(&ax->buflock);
        skb->protocol = ax25_type_trans(skb, ax->dev);
        netif_rx(skb);
        ax->dev->last_rx = jiffies;
        ax->stats.rx_packets++;
        ax->stats.rx_bytes += count;
+       spin_unlock_bh(&ax->buflock);
 }
 
 static void kiss_unesc(struct mkiss *ax, unsigned char s)
@@ -821,7 +820,7 @@ static void mkiss_close(struct tty_struct *tty)
        tty->disc_data = NULL;
        write_unlock(&disc_data_lock);
 
-       if (ax == 0)
+       if (!ax)
                return;
 
        /*