]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vivid: Fix iteration in driver removal path
authorEzequiel Garcia <ezequiel@vanguardiasur.com.ar>
Mon, 28 Sep 2015 21:36:51 +0000 (18:36 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Feb 2016 22:28:29 +0000 (14:28 -0800)
commit3bfcf7dc51cfcdb3c421a780492190396728edd0
tree4b193252f54a334d53b56e7f2fd68696cdb69233
parente266f6c3b75c6b1695483685ab16f2cdb54e47ec
vivid: Fix iteration in driver removal path

commit a5d42b8c3b3ddccd88dc1c70957177d31a6699fb upstream.

When the diver is removed and all the resources are deallocated,
we should be iterating through the created devices only.

Currently, the iteration ends when vivid_devs[i] is NULL. Since
the array contains VIVID_MAX_DEVS elements, it will oops if
n_devs=VIVID_MAX_DEVS because in that case, no element is NULL.

Fixes: c88a96b023d8 ('[media] vivid: add core driver code')
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/vivid/vivid-core.c