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)
commit42ec2f0714858376db064e87674c491d7f457e5d
tree0a3947c17b500d5e9c538e07b5185ad7830bed3b
parenta3b36a8ce3d0c277fe243fa1be6bd3f606ed130f
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