ALSA: pcm: oss: Place the plugin buffer overflow checks correctly
authorTakashi Iwai <tiwai@suse.de>
Fri, 24 Apr 2020 19:33:50 +0000 (21:33 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 24 Apr 2020 19:34:52 +0000 (21:34 +0200)
commit4285de0725b1bf73608abbcd35ad7fd3ddc0b61e
tree3581be5ed3b84b93541d952185b5a12567527e6a
parentae769d3556644888c964635179ef192995f40793
ALSA: pcm: oss: Place the plugin buffer overflow checks correctly

The checks of the plugin buffer overflow in the previous fix by commit
  f2ecf903ef06 ("ALSA: pcm: oss: Avoid plugin buffer overflow")
are put in the wrong places mistakenly, which leads to the expected
(repeated) sound when the rate plugin is involved.  Fix in the right
places.

Also, at those right places, the zero check is needed for the
termination node, so added there as well, and let's get it done,
finally.

Fixes: f2ecf903ef06 ("ALSA: pcm: oss: Avoid plugin buffer overflow")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200424193350.19678-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/oss/pcm_plugin.c