diff options
author | Jesper Juhl <jj@chaosbits.net> | 2012-03-24 21:39:18 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-10 23:33:27 (GMT) |
commit | 4ae2e594b70b04fb90fd5fef96a996f42ecea7d5 (patch) | |
tree | 3617e18f2be20ac4888c8f008c2478a2c7859923 /drivers/staging/media | |
parent | 96371fc89b7f813a38739946eb7ea7c0a841fd86 (diff) | |
download | linux-fsl-qoriq-4ae2e594b70b04fb90fd5fef96a996f42ecea7d5.tar.xz |
[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>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/as102/as102_fw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/as102/as102_fw.c b/drivers/staging/media/as102/as102_fw.c index 43ebc43..1075fb1 100644 --- a/drivers/staging/media/as102/as102_fw.c +++ b/drivers/staging/media/as102/as102_fw.c @@ -165,7 +165,7 @@ error: int as102_fw_upload(struct as10x_bus_adapter_t *bus_adap) { int errno = -EFAULT; - const struct firmware *firmware; + const struct firmware *firmware = NULL; unsigned char *cmd_buf = NULL; char *fw1, *fw2; struct usb_device *dev = bus_adap->usb_dev; |