exynos4: index out of bounds if no pixelcode found

2013-10-13 Thread Roel Kluin
In case no valid pixelcode is found, an i of -1 after the loop is out of bounds for the array. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/platform/exynos4-is/fimc-lite-reg.c b/drivers/media/platform/exynos4-is/fimc-lite-reg.c index 72a343e3b..d0dc7ee 100644

tda10023.c: misplaced parentheses?

2010-02-23 Thread Roel Kluin
In tda10023_read_signal_strength() we have: u16 gain = ((255-tda10023_readreg(state, 0x17))) + (255-ifgain)/16; ---^ The closing parenthesis appears misplaced, should this be: u16 gain = ((255-tda10023_readreg(state, 0x17)) +

Re: [PATCH] video_device: don't free_irq() an element past array vpif_obj.dev[] and fix test

2010-02-19 Thread Roel Kluin
Ok. You are right! The ch_params[] is a table for keeping the information about different standards supported. For a given stdid in std_info, the function matches the stdid with that in the table and get the corresponding entry. + if (k == VPIF_DISPLAY_MAX_DEVICES) + k

Re: [PATCH] video_device: don't free_irq() an element past array vpif_obj.dev[] and fix test

2010-02-19 Thread Roel Kluin
, not in the case of other errors. Also I changed some indexes, so a few could be removed. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- There were some errors in the changelog and a signoff was missing. Ok. You are right! The ch_params[] is a table for keeping the information about

Re: [PATCH] video_device: don't free_irq() an element past array vpif_obj.dev[] and fix test

2010-02-19 Thread Roel Kluin
, not in the case of other errors. Also I changed some indexes, so a few could be removed. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- I think there were many more issues: I must admit I did not compile test this, except with checkpatch.pl, but I think the issues are real and should

Re: [PATCH] video_device: don't free_irq() an element past array vpif_obj.dev[] and fix test

2010-02-18 Thread roel kluin
-      if (!std_info) +      if (!std_info-stdid)               return -1; This is a NACK. We shouldn't check for stdid since the function is supposed to update std_info. So just remove if (!std_info)        return -1; I don't see how std_info could get updated. consider the loop in case

[PATCH] dvb-usb/opera1: misplaced parenthesis

2010-02-15 Thread Roel Kluin
The parenthesis was misplaced, tmp is set to 0 or break occurs, while debugging opera1_usb_i2c_msgxfer() retval was not shown. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c index d4e2309..8305576 100644

[PATCH] video_device: don't free_irq() an element past array vpif_obj.dev[] and fix test

2010-02-09 Thread Roel Kluin
the probe_out: label, k also reaches VPIF_DISPLAY_MAX_DEVICES after the loop. In the first iteration in the loop after vpif_int_err: a free_irq() can occur of an element vpif_obj.dev[VPIF_DISPLAY_MAX_DEVICES]-channel_id which is outside vpif_obj.dev[] array boundaries. Signed-off-by: Roel Kluin roel.kl

[PATCH] usbvision-video: wrong variable tested in usbvision_register_video()

2010-02-07 Thread Roel Kluin
usbvision-vdev was already tested, we should test usbvision-vbi here. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index 1054546..7c17ec6 100644 --- a/drivers/media/video

Re: [PATCH] dvb: return -ENOMEM if kzalloc failed in dvb_usb_device_init()

2010-02-03 Thread roel kluin
On Tue, Feb 2, 2010 at 3:29 PM, Oliver Neukum oli...@neukum.org wrote: Am Dienstag, 2. Februar 2010 15:29:46 schrieb Roel Kluin: If in a cold state and the download succeeded ret is zero, but we should return -ENOMEM. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Or shouldn't we? We

[PATCH] radio-si470x-common: -EINVAL overwritten in si470x_vidioc_s_tuner()

2010-02-03 Thread Roel Kluin
The -EINVAL was overwritten by the si470x_disconnect_check(). Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Is this needed? diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c index 4da0f15..65b4a92 100644 --- a/drivers/media

[PATCH] dvb: return -ENOMEM if kzalloc failed in dvb_usb_device_init()

2010-02-02 Thread Roel Kluin
If in a cold state and the download succeeded ret is zero, but we should return -ENOMEM. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Or shouldn't we? diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c index e331db8..5d91f70 100644

[PATCH] cx23885: Wrong command printed in cmd_to_str()

2010-01-19 Thread Roel Kluin
The wrong command was printed for case CX2341X_ENC_SET_DNR_FILTER_MODE, and a typo in case CX2341X_ENC_SET_PCR_ID. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Or is this intended? diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c index

[PATCH] mxl5005s: bad checks of state-Mode

2010-01-19 Thread Roel Kluin
Regardless of the state-Mode in both cases the same value was written. If state-Mode wasn't set, it is always 0. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- drivers/media/common/tuners/mxl5005s.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) Or were the ones and zeroes

V4L/DVB ivtv-yuv.c: args-dst.left assigned to both nf-tru_x and nf-dst_x in ivtv_yuv_setup_frame()

2010-01-15 Thread Roel Kluin
vi drivers/media/video/ivtv/ivtv-yuv.c +971 and note that `args-dst.left' is assigned both to nf-tru_x and nf-dst_x, is that ok? Roel -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH] V4L/DVB (12930): Wrong variable tested

2010-01-03 Thread Roel Kluin
The return of saa7164_i2caddr_to_reglen() was not tested. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- drivers/media/video/saa7164/saa7164-api.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/saa7164/saa7164-api.c b/drivers/media/video

[PATCH] V4L/DVB: use correct size in put_v4l2_window32()

2009-12-16 Thread Roel Kluin
Although these sizes may be the same it is better to calculate the size of the source, than the destiny. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c index 997975d..23ad218 100644

[PATCH] gspca: Fix tests of unsigned

2009-12-16 Thread Roel Kluin
val and sd-gain are unsigned so the tests did not work. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Found using coccinelle: http://coccinelle.lip6.fr/ diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index 4dbb882..f5d1f18 100644 --- a/drivers/media

[PATCH] vivi: Fix test of unsigned in vivi_create_instance()

2009-12-16 Thread Roel Kluin
video_nr is unsigned so the test did not work. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Found using coccinelle: http://coccinelle.lip6.fr/ diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 7705fc6..328af3a 100644 --- a/drivers/media/video/vivi.c +++ b/drivers

[PATCH] sms-cards.c: Ensure index is positive

2009-11-02 Thread Roel Kluin
The index is signed, make sure it is not negative when we read the array element. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- drivers/media/dvb/siano/sms-cards.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/dvb/siano/sms-cards.c b/drivers/media

[PATCH] V4L/DVB: keep index within bound in vpfe_cropcap()

2009-10-26 Thread Roel Kluin
If vpfe_dev-std_index equals ARRAY_SIZE(vpfe_standards), that is one too large Signed-off-by: Roel Kluin roel.kl...@gmail.com --- drivers/media/video/davinci/vpfe_capture.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/davinci/vpfe_capture.c b

[PATCH] v4l: Cleanup redundant tests on unsigned

2009-10-23 Thread Roel Kluin
The variables are unsigned so the test `= 0' is always true, the ` 0' test always fails. In these cases the other part of the test catches wrapped values. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/common/tuners/tda9887.c b/drivers/media/common/tuners/tda9887.c

Re: [PATCH] v4l: Cleanup redundant tests on unsigned

2009-10-23 Thread Roel Kluin
Op 23-10-09 12:59, Roel Kluin schreef: The variables are unsigned so the test `= 0' is always true, the ` 0' test always fails. In these cases the other part of the test catches wrapped values. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- I forgot the stats: drivers/media/common

[PATCH] tuner-simple: possible read buffer overflow?

2009-10-03 Thread Roel Kluin
Prevent read from t_params-ranges[-1]. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- This is only required when t_params-count can be 0, can it? Roel diff --git a/drivers/media/common/tuners/tuner-simple.c b/drivers/media/common/tuners/tuner-simple.c index 8abbcc5..e679d5f 100644

[PATCH] V4L/DVB (7969): kmalloc failure ignored in m920x_firmware_download()

2009-09-18 Thread Roel Kluin
Prevent NULL dereference if kmalloc() fails. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Found with sed: http://kernelnewbies.org/roelkluin Build tested. diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c index aec7a19..ef9b7be 100644 --- a/drivers/media

[PATCH] V4L/DVB (11380): kzalloc failure ignored in au8522_probe()

2009-09-18 Thread Roel Kluin
Prevent NULL dereference if kzalloc() fails. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Found with sed: http://kernelnewbies.org/roelkluin Build tested. diff --git a/drivers/media/dvb/frontends/au8522_decoder.c b/drivers/media/dvb/frontends/au8522_decoder.c index 9e9a755..74981ee

[PATCH] V4L/DVB (9367): kmalloc failure ignored in lgdt3304_attach()

2009-09-18 Thread Roel Kluin
Prevent NULL dereference if kmalloc() fails. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Found with sed: http://kernelnewbies.org/roelkluin Build tested. diff --git a/drivers/media/dvb/frontends/lgdt3304.c b/drivers/media/dvb/frontends/lgdt3304.c index eb72a98..e334b5d 100644

[PATCH] GSPCA: kmalloc failure ignored in sd_start()

2009-09-18 Thread Roel Kluin
Prevent NULL dereference if kmalloc() fails. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Found with sed: http://kernelnewbies.org/roelkluin diff --git a/drivers/media/video/gspca/jeilinj.c b/drivers/media/video/gspca/jeilinj.c index dbfa3ed..a11c97e 100644 --- a/drivers/media/video/gspca

[PATCH] uvc: kmalloc failure ignored in uvc_ctrl_add_ctrl()

2009-09-18 Thread Roel Kluin
Produce an error if kmalloc() fails. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Found with sed: http://kernelnewbies.org/roelkluin Build tested. Please review diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index c3225a5..dda80b5 100644

[PATCH] V4L/DVB (12098): dereference of state-internal in fe_stv0900_error stv0900_init_internal()

2009-08-29 Thread Roel Kluin
state-internal allocation may fail as well as the allocation of stv0900_first_inode or new_node-next_inode in append_internal(). Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Is this the right thing to do if temp_int == NULL? diff --git a/drivers/media/dvb/frontends/stv0900_core.c b

[PATCH] V4L/DVB: Fix test of bandwidth range in cx22700_set_tps()

2009-08-25 Thread Roel Kluin
For the bandwidth to be less than 8 MHZ and greater than 6 MHZ is logically impossible. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/dvb/frontends/cx22700.c b/drivers/media/dvb/frontends/cx22700.c index fbd838e..5fbc0fc 100644 --- a/drivers/media/dvb/frontends

[PATCH] cx18: Read buffer overflow

2009-07-29 Thread Roel Kluin
The guard mistakenly tests against sizeof(freqs) instead of ARRAY_SIZE(freqs). Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Andy Walls wrote: The cx18 driver suffers from the exact same defect in cx18-controls.c. Thanks, if not already applied, here is it. diff --git a/drivers/media

[PATCH] stk-webcam: Read buffer overflow

2009-07-24 Thread Roel Kluin
It tested the value of stk_sizes[i].m before checking whether i was in range. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c index 4d6785e..b154bd9 100644 --- a/drivers/media/video/stk-webcam.c +++ b/drivers

[PATCH] Siano: Read buffer overflow

2009-07-23 Thread Roel Kluin
With mode DEVICE_MODE_RAW_TUNER a read occurs past the end of smscore_fw_lkup[]. Subsequently an attempt is made to load the firmware from the resulting filename. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- This can be reached only when coredev-device_flags contains SMS_DEVICE_FAMILY2

[PATCH] Read buffer overflow

2009-07-23 Thread Roel Kluin
parport[n] is checked before n MAX_CAMS Signed-off-by: Roel Kluin roel.kl...@gmail.com --- probably harmless diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c index 10dbd4a..9e39bc5 100644 --- a/drivers/media/video/bw-qcam.c +++ b/drivers/media/video/bw-qcam.c @@ -992,7

[PATCH] ivtv: Read buffer overflow

2009-07-23 Thread Roel Kluin
This mistakenly tests against sizeof(freqs) instead of the array size. Due to the mask the only illegal value possible was 3. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/video/ivtv/ivtv-controls.c b/drivers/media/video/ivtv/ivtv-controls.c index a3b77ed..4a9c8ce

[PATCH] media: remove redundant tests on unsigned

2009-06-22 Thread Roel Kluin
input, inp and i are unsigned. When negative they are wrapped and caught by the other test. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c index ce64c62..8986d96 100644 --- a/drivers/media/dvb/ttpci

[PATCH] tvp514x: try_count off by one.

2009-06-04 Thread Roel Kluin
with `while (try_count-- 0)' try_count reaches -1 after the loop. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c index 4262e60..3750f7f 100644 --- a/drivers/media/video/tvp514x.c +++ b/drivers/media/video/tvp514x.c

gspca: usb_set_interface() required for ISOC ep with altsetting of 0?

2009-06-04 Thread Roel Kluin
I noted that in get_ep() in drivers/media/video/gspca/gspca.c usb_set_interface() is not called for an ISOC endpoint with an altsetting of 0. Is that ok? Roel -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More

[PATCH] V4L/DVB: cleanup redundant tests on unsigned

2009-05-02 Thread Roel Kluin
Remove redundant tests on unsigned. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- All tests are similar to `if (x 0 || x MAX) ...' where x is unsigned. When x is negative, wrapping occurs. Only the second half is effective. drivers/media/dvb/ttpci/av7110_v4l.c|2

[PATCH] zoran: Fix /|| typo

2009-05-02 Thread Roel Kluin
Fix /|| typo diff --git a/drivers/media/video/zoran/zoran_card.c b/drivers/media/video/zoran/zoran_card.c index ea6c577..ea9de8b 100644 --- a/drivers/media/video/zoran/zoran_card.c +++ b/drivers/media/video/zoran/zoran_card.c @@ -1022,7 +1022,7 @@ zr36057_init (struct zoran *zr)

[PATCH] V4L/DVB: / typo

2009-04-26 Thread Roel Kluin
binary/logical and typo Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/video/cx23885/cimax2.c b/drivers/media/video/cx23885/cimax2.c index 9a65369..08582e5 100644 --- a/drivers/media/video/cx23885/cimax2.c +++ b/drivers/media/video/cx23885/cimax2.c @@ -312,7 +312,7

[PATCH] zoran: invalid test on unsigned

2009-04-26 Thread Roel Kluin
fmt-index is unsigned. test doesn't work Signed-off-by: Roel Kluin roel.kl...@gmail.com --- Is there another test required? diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c index 092333b..0db5d0f 100644 --- a/drivers/media/video/zoran

[PATCH] V4L/DVB: calibration still successful at 10

2009-02-11 Thread Roel Kluin
With while (i++ 10) { ... } i can reach 11, so callibration still succeeds at i == 10. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/common/tuners/mt2060.c b/drivers/media/common/tuners/mt2060.c index 12206d7..c7abe3d 100644 --- a/drivers/media/common/tuners

Re: [PATCH] v4l/tvp514x: try_count reaches 0, not -1

2009-02-10 Thread Roel Kluin
Roel Kluin wrote: with while (try_count-- 0) { ... } try_count reaches 0, not -1. Sorry but this is bogus, please ignore. -- To unsubscribe from this list: send the line unsubscribe linux-media in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

[PATCH] decrement address_err as well as retries.

2009-02-02 Thread Roel Kluin
Since we want to determine whether every retry we had an address_err, and we decrement retries, we should decrement address_err as well. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/common/saa7146_i2c.c b/drivers/media/common/saa7146_i2c.c index c11da4d..2fac001

Re: [PATCH] newport: newport_*wait() return 0 on timeout

2009-02-02 Thread roel kluin
2009/2/2 Mauro Carvalho Chehab mche...@infradead.org: Hi Roel, It seems that you've sent this driver to the wrong ML. Video adapters are not handled on those ML's. Any idea where it should be sent? Thanks, Roel -- To unsubscribe from this list: send the line unsubscribe linux-media in the

[PATCH] newport: newport_*wait() return 0 on timeout

2009-01-31 Thread Roel Kluin
With a postfix decrement t reaches -1 on timeout which results in a return of 0. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/include/video/newport.h b/include/video/newport.h index 1f5ebea..001b935 100644 --- a/include/video/newport.h +++ b/include/video/newport.h @@ -453,7

[PATCH] V4L/DVB: fix v4l2_device_call_all/v4l2_device_call_until_err macro

2009-01-22 Thread Roel Kluin
When these macros aren't called with 'grp_id' this will result in a build failure. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index 9bf4ccc..ad86caa 100644 --- a/include/media/v4l2-device.h +++ b/include/media/v4l2

[PATCH] V4L/DVB: make card signed

2009-01-18 Thread Roel Kluin
Is this correct? ---8--8 make card signed Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index ef9bf00..7c7a96c 100644 --- a/drivers/media/video/em28xx

[PATCH] DVB: negative internal-sub_range won't get noticed

2009-01-18 Thread Roel Kluin
internal-sub_range is unsigned, a negative won't get noticed. Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/dvb/frontends/stb0899_algo.c b/drivers/media/dvb/frontends/stb0899_algo.c index 83dc7e1..2ea32da 100644 --- a/drivers/media/dvb/frontends/stb0899_algo.c

[PATCH] Bttv: move check on unsigned

2009-01-17 Thread Roel Kluin
drivers/media/video/bt8xx/bttvp.h +381 since norm is unsigned in set_tvnorm, a negative won't get noticed. so remove the redundant check and move it to the caller. My question is: should we error return like this? Signed-off-by: Roel Kluin roel.kl...@gmail.com --- diff --git a/drivers/media/video