Commit c68a99cd authored by Paul Fulghum's avatar Paul Fulghum Committed by Linus Torvalds

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: default avatarPaul Fulghum <paulkf@microgate.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 814dae03
......@@ -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 */
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment