From: Paul Fulghum Date: Tue, 22 Jul 2008 10:23:24 +0000 (+0100) Subject: synclink_gt fix locking in error path of rx enable X-Git-Tag: v2.6.27-rc1~869 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c68a99cda87a8356ea0e56cc5111043ac8402ffd;p=linux-2.6-omap-h63xx.git synclink_gt fix locking in error path of rx enable 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 Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 5ffdb364ea4..3e9058993e4 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c @@ -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 */ }