staging: most: sound: add sanity check for function argument
authorChristian Gromm <christian.gromm@microchip.com>
Tue, 2 Feb 2021 16:21:05 +0000 (17:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Feb 2021 16:13:46 +0000 (17:13 +0100)
commit45b754ae5b82949dca2b6e74fa680313cefdc813
tree4dd3b1d491a1bb86d1a7a7835a4b80a676f3738d
parent06b0c0dce88e2aa2f01343db0f26d214d7f264a0
staging: most: sound: add sanity check for function argument

This patch checks the function parameter 'bytes' before doing the
subtraction to prevent memory corruption.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/sound/sound.c