The patch number 9599 was added via Andy Walls <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Andy Walls  <[EMAIL PROTECTED]>
cx18: Fix unitialized variable problem upon APU firmware file read failure


If APU firmware file read failed, the jump vector to the APU was undefined and
the APU would be started executing garbage.  Fix uninitialized variable to be
an infinite loop for the APU, but also bail out before even starting the APU.

Priority: normal

Signed-off-by: Andy Walls <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/cx18/cx18-firmware.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff -r 67278296c717 -r 94fa8084355e 
linux/drivers/media/video/cx18/cx18-firmware.c
--- a/linux/drivers/media/video/cx18/cx18-firmware.c    Sun Nov 09 16:14:07 
2008 -0500
+++ b/linux/drivers/media/video/cx18/cx18-firmware.c    Sun Nov 09 17:51:44 
2008 -0500
@@ -153,7 +153,7 @@ static int load_apu_fw_direct(const char
                return -ENOMEM;
        }
 
-       *entry_addr = 0xffffffff;
+       *entry_addr = 0;
        src = (const u32 *)fw->data;
        vers = fw->data + sizeof(seghdr);
        sz = fw->size;
@@ -170,7 +170,7 @@ static int load_apu_fw_direct(const char
                }
                CX18_DEBUG_INFO("load segment %x-%x\n", seghdr.addr,
                                seghdr.addr + seghdr.size - 1);
-               if (*entry_addr == 0xffffffff)
+               if (*entry_addr == 0)
                        *entry_addr = seghdr.addr;
                if (offset + seghdr.size > sz)
                        break;
@@ -340,9 +340,12 @@ int cx18_firmware_init(struct cx18 *cx)
 
        /* Only if the processor is not running */
        if (cx18_read_reg(cx, CX18_PROC_SOFT_RESET) & 8) {
-               u32 fw_entry_addr;
+               u32 fw_entry_addr = 0;
                int sz = load_apu_fw_direct("v4l-cx23418-apu.fw",
                               cx->enc_mem, cx, &fw_entry_addr);
+
+               if (sz <= 0)
+                       return sz;
 
                /* Clear bit0 for APU to start from 0 */
                cx18_write_reg(cx, cx18_read_reg(cx, 0xc72030) & ~1, 0xc72030);


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/94fa8084355e7a7431f041b12ad83753c41aac8b

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to