Re: [PATCH] [media] cx18: introduce a helper function to void array overrun

2014-01-05 Thread Ethan Zhao
On Sun, Jan 5, 2014 at 2:09 PM, Dmitry Torokhov wrote: > Hi Ethan, > > On Sun, Jan 05, 2014 at 09:17:39AM +0800, Ethan Zhao wrote: >> cx18_i2c_register() is called in cx18_init_subdevs() with index >> greater than length of hw_bus array, that will cause array overrun, >> introduce a helper cx18_ge

Re: [PATCH] [media] cx18: introduce a helper function to void array overrun

2014-01-04 Thread Dmitry Torokhov
Hi Ethan, On Sun, Jan 05, 2014 at 09:17:39AM +0800, Ethan Zhao wrote: > cx18_i2c_register() is called in cx18_init_subdevs() with index > greater than length of hw_bus array, that will cause array overrun, > introduce a helper cx18_get_max_bus_num() to void it. s/void/avoid/ > > Signed-off-by:

[PATCH] [media] cx18: introduce a helper function to void array overrun

2014-01-04 Thread Ethan Zhao
cx18_i2c_register() is called in cx18_init_subdevs() with index greater than length of hw_bus array, that will cause array overrun, introduce a helper cx18_get_max_bus_num() to void it. Signed-off-by: Ethan Zhao --- drivers/media/pci/cx18/cx18-driver.c | 2 +- drivers/media/pci/cx18/cx18-i2c.c