camera: fix ov5640 sensor driver slab corruption in multi-regs write
authorddl <ddl@rockchip.com>
Thu, 1 Sep 2011 09:43:00 +0000 (17:43 +0800)
committerddl <ddl@rockchip.com>
Thu, 1 Sep 2011 09:43:51 +0000 (17:43 +0800)
drivers/media/video/ov5640.c

index 21eb6889f50e308d4f513dcfee2857ac4f482ea6..2270c5649f3a494514fbf7565332d9eabc870ae8 100755 (executable)
@@ -1638,7 +1638,7 @@ static int sensor_write_array(struct i2c_client *client, struct reginfo *regarra
                        int size_num;
                        size_num = reg_num + 1;
                        
-                       ptemp = phead = (u8*)kmalloc(size_num*sizeof(u8),GFP_KERNEL);
+                       ptemp = phead = (u8*)kmalloc((size_num+10)*sizeof(u8),GFP_KERNEL);
                        if (!phead) {
                                SENSOR_DG("-------------write registers allocate memory fail!!!\n");
                 i = j;