Skip to content

Commit

Permalink
synclink_gt fix locking in error path of rx enable
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Fulghum authored and Linus Torvalds committed Jul 22, 2008
1 parent 814dae0 commit c68a99c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/char/synclink_gt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down

0 comments on commit c68a99c

Please sign in to comment.