staging/media/as102: Don't call release_firmware() on uninitialized variable
authorJesper Juhl <jj@chaosbits.net>
Sat, 24 Mar 2012 22:39:18 +0000 (23:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Apr 2012 16:17:33 +0000 (09:17 -0700)
commit401c90e56c48b1c642507a8bec91b7ae21f1156e
tree8247bc25bf858747e62719a231e5a7eb9562031f
parent218f4d437d69b4621f36affd52dcd6343597149a
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/as102/as102_fw.c