[media] staging/media/as102: Don't call release_firmware() on uninitialized variable
authorJesper Juhl <jj@chaosbits.net>
Sat, 24 Mar 2012 21:39:18 +0000 (18:39 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 10 Apr 2012 23:33:27 +0000 (20:33 -0300)
commit4ae2e594b70b04fb90fd5fef96a996f42ecea7d5
tree3617e18f2be20ac4888c8f008c2478a2c7859923
parent96371fc89b7f813a38739946eb7ea7c0a841fd86
[media] staging/media/as102: Don't call release_firmware() on uninitialized variable

If, in drivers/staging/media/as102/as102_fw.c::as102_fw_upload(), the call
cmd_buf = kzalloc(MAX_FW_PKT_SIZE, GFP_KERNEL);
should fail and return NULL so that we jump to the 'error:' label,
then we'll end up calling 'release_firmware(firmware);' with
'firmware' still uninitialized - not good.

The easy fix is to just initialize 'firmware' to NULL when we declare
it, since release_firmware() deals gracefully with being passed NULL
pointers.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/media/as102/as102_fw.c