synclink_gt fix locking in error path of rx enable
authorPaul Fulghum <paulkf@microgate.com>
Tue, 22 Jul 2008 10:23:24 +0000 (11:23 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Jul 2008 20:03:29 +0000 (13:03 -0700)
Fix locking in error path of rx_enable() introduced by
synclink_gt-add-rx-dma-buffer-fill-level-control patch.

Signed-off-by: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/synclink_gt.c

index 5ffdb364ea4093cec29ff306779ebdc77ff11ab4..3e9058993e41805c0b2cd699ad836c76844fe398 100644 (file)
@@ -2686,8 +2686,10 @@ static int rx_enable(struct slgt_info *info, int enable)
         */
        rbuf_fill_level = ((unsigned int)enable) >> 16;
        if (rbuf_fill_level) {
-               if ((rbuf_fill_level > DMABUFSIZE) || (rbuf_fill_level % 4))
+               if ((rbuf_fill_level > DMABUFSIZE) || (rbuf_fill_level % 4)) {
+                       spin_unlock_irqrestore(&info->lock, flags);
                        return -EINVAL;
+               }
                info->rbuf_fill_level = rbuf_fill_level;
                rx_stop(info); /* restart receiver to use new fill level */
        }