[PATCH] [media] zoran: fix integer overflow in setup_window()

2012-04-09 Thread Xi Wang
Also change the corresponding parameter type to `unsigned int'. Signed-off-by: Xi Wang --- The upper bound `2048' is from get_v4l2_window32() in drivers/media/video/v4l2-ioctl.c. bt8xx and saa7134 also use the bound for `clipcount'. --- drivers/media/video/zoran/zoran_driver.c | 20

[PATCH 2/2] [media] v4l2-ctrls: fix integer overflow in try_set_ext_ctrls()

2012-04-06 Thread Xi Wang
A large cs->count from userspace may overflow the allocation size, leading to memory corruption. try_set_ext_ctrls() can be reached from subdev_do_ioctl() or __video_do_ioctl(). Use kmalloc_array() to avoid the overflow. Signed-off-by: Xi Wang --- drivers/media/video/v4l2-ctrls.c |

[PATCH 1/2] [media] v4l2-ctrls: fix integer overflow in v4l2_g_ext_ctrls()

2012-04-06 Thread Xi Wang
A large cs->count from userspace may overflow the allocation size, leading to memory corruption. v4l2_g_ext_ctrls() can be reached from subdev_do_ioctl() or __video_do_ioctl(). Use kmalloc_array() to avoid the overflow. Signed-off-by: Xi Wang --- drivers/media/video/v4l2-ctrls.c |3 ++-

[PATCH] lgdt330x: fix signedness error in i2c_read_demod_bytes()

2012-02-14 Thread Xi Wang
urn type of i2c_read_demod_bytes() to int. Also change the return value on error to -EIO to make (err < 0) work. Signed-off-by: Xi Wang Cc: sta...@vger.kernel.org --- drivers/media/dvb/frontends/lgdt330x.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dri

[PATCH 2/3] wl128x: fmdrv_rx: fix signedness bugs

2011-12-02 Thread Xi Wang
The error handling with (ret < 0) didn't work where ret is a u32. Use int instead. To be consistent we also change the functions to return an int. Signed-off-by: Xi Wang --- drivers/media/radio/wl128x/fmdrv_rx.c | 84 + drivers/media/radio/wl128x/fm

[PATCH 3/3] wl128x: fmdrv_tx: fix signedness bugs

2011-12-02 Thread Xi Wang
The error handling with (ret < 0) didn't work where ret is a u32. Use int instead. To be consistent we also change the functions to return an int. Signed-off-by: Xi Wang --- drivers/media/radio/wl128x/fmdrv_tx.c | 61 + drivers/media/radio/wl128x/fm

[PATCH 1/3] wl128x: fmdrv_common: fix signedness bugs

2011-12-02 Thread Xi Wang
The error handling with (ret < 0) didn't work where ret is a u32. Use int instead. To be consistent we also change the functions to return an int. Signed-off-by: Xi Wang --- drivers/media/radio/wl128x/fmdrv_common.c | 58 ++--- drivers/media/radi

[PATCH 0/3] wl128x: fix multiple signedness bugs

2011-12-02 Thread Xi Wang
Fix multiple signedness bugs which would break the error handling. Xi Wang (3): wl128x: fmdrv_common: fix signedness bugs wl128x: fmdrv_rx: fix signedness bugs wl128x: fmdrv_tx: fix signedness bugs drivers/media/radio/wl128x/fmdrv_common.c | 58 ++-- drivers/media/radio