]> err.no Git - linux-2.6/blobdiff - drivers/char/n_hdlc.c
random: remove cacheline alignment for locks
[linux-2.6] / drivers / char / n_hdlc.c
index 37f7d3403040395bd1a5abfb484c5b76c77fc015..06803ed5568ccbad5c0a2c470d5c060d13b82dfc 100644 (file)
@@ -229,7 +229,7 @@ static void n_hdlc_release(struct n_hdlc *n_hdlc)
        wake_up_interruptible (&tty->read_wait);
        wake_up_interruptible (&tty->write_wait);
 
-       if (tty != NULL && tty->disc_data == n_hdlc)
+       if (tty->disc_data == n_hdlc)
                tty->disc_data = NULL;  /* Break the tty->n_hdlc link */
 
        /* Release transmit and receive buffers */
@@ -400,7 +400,12 @@ static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty)
                /* Send the next block of data to device */
                tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
                actual = tty->driver->write(tty, tbuf->buf, tbuf->count);
-                   
+
+               /* rollback was possible and has been done */
+               if (actual == -ERESTARTSYS) {
+                       n_hdlc->tbuf = tbuf;
+                       break;
+               }
                /* if transmit error, throw frame away by */
                /* pretending it was accepted by driver */
                if (actual < 0)
@@ -496,7 +501,7 @@ static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data,
                        __FILE__,__LINE__, count);
                
        /* This can happen if stuff comes in on the backup tty */
-       if (n_hdlc == 0 || tty != n_hdlc->tty)
+       if (!n_hdlc || tty != n_hdlc->tty)
                return;
                
        /* verify line is using HDLC discipline */