mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 08:48:48 +00:00
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 <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>
This commit is contained in:
parent
814dae031d
commit
c68a99cda8
@ -2686,8 +2686,10 @@ static int rx_enable(struct slgt_info *info, int enable)
|
|||||||
*/
|
*/
|
||||||
rbuf_fill_level = ((unsigned int)enable) >> 16;
|
rbuf_fill_level = ((unsigned int)enable) >> 16;
|
||||||
if (rbuf_fill_level) {
|
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;
|
return -EINVAL;
|
||||||
|
}
|
||||||
info->rbuf_fill_level = rbuf_fill_level;
|
info->rbuf_fill_level = rbuf_fill_level;
|
||||||
rx_stop(info); /* restart receiver to use new fill level */
|
rx_stop(info); /* restart receiver to use new fill level */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user