]> git.baikalelectronics.ru Git - kernel.git/commit
media: atomisp: fix uninitialized stack mem usage in ia_css_rmgr_acq_vbuf()
authorHans de Goede <hdegoede@redhat.com>
Sun, 12 Jun 2022 16:05:55 +0000 (17:05 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 16:44:52 +0000 (17:44 +0100)
commitf5a5564b37a61c607d9f58a7ae841c6e7a8447b6
tree0a3947c17b500d5e9c538e07b5185ad7830bed3b
parent63868f568eb70bda190367cce492070d18018828
media: atomisp: fix uninitialized stack mem usage in ia_css_rmgr_acq_vbuf()

When ia_css_rmgr_acq_vbuf() enters the code path where it uses the local
"struct ia_css_rmgr_vbuf_handle v" on the stack it relies on v.count==0
so that ia_css_rmgr_refcount_retain_vbuf allocates a new handle.

Explicitly set v.count to 0 rather then it being whatever was on the stack.

Link: https://lore.kernel.org/linux-media/20220612160556.108264-3-hdegoede@redhat.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c