From c68a99cda87a8356ea0e56cc5111043ac8402ffd Mon Sep 17 00:00:00 2001 From: Paul Fulghum Date: Tue, 22 Jul 2008 11:23:24 +0100 Subject: [PATCH] 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 --- drivers/char/synclink_gt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 5ffdb364ea..3e9058993e 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 */ } -- 2.39.5