Re: [PATCH-next] media: s2255drv: Remove unneeded if else blocks

2018-01-25 Thread walter harms
Am 24.01.2018 22:40, schrieb Christopher Díaz Riveros: > Given the following definitions from s2255drv.c > > #define LINE_SZ_4CIFS_NTSC 640 > #define LINE_SZ_2CIFS_NTSC 640 > #define LINE_SZ_1CIFS_NTSC 320 > > and > > #define LINE_SZ_4CIFS_PAL 704 > #define

Re: [PATCH 2/2] staging/atomisp: putting NULs in the wrong place

2017-05-15 Thread walter harms
Am 15.05.2017 12:01, schrieb Dan Carpenter: > We're putting the NUL terminators one space beyond where they belong. > This doesn't show up in testing because all but the callers put a NUL in > the correct place themselves. LOL. It causes a static checker warning > about buffer overflows. > >

Re: [PATCH 2/2] staging: atomisp: use local variable to reduce the number of reference

2017-03-30 Thread walter harms
Am 30.03.2017 08:25, schrieb Daeseok Youn: > Define new local variable to reduce the number of reference. > The new local variable is added to save the addess of dfs > and used in atomisp_freq_scaling() function. > > Signed-off-by: Daeseok Youn > --- >

Re: [PATCH] [media] coda: remove redundant call to v4l2_m2m_get_vq

2017-03-27 Thread walter harms
Am 27.03.2017 12:10, schrieb Philipp Zabel: > On Mon, 2017-03-27 at 11:46 +0200, Hans Verkuil wrote: >> On 23/03/17 12:57, Colin King wrote: >>> From: Colin Ian King >>> >>> The call to v4ls_m2m_get_vq is only used to get the return value >>> which is not being used,

Re: [PATCH 2/4] staging: atomisp: simplify if statement in atomisp_get_sensor_fps()

2017-03-20 Thread walter harms
Am 20.03.2017 13:51, schrieb DaeSeok Youn: > 2017-03-20 21:04 GMT+09:00 walter harms <wha...@bfs.de>: >> >> >> Am 20.03.2017 11:59, schrieb Daeseok Youn: >>> If v4l2_subdev_call() gets the global frame interval values, >>> it returned 0 and

Re: [PATCH 2/4] staging: atomisp: simplify if statement in atomisp_get_sensor_fps()

2017-03-20 Thread walter harms
Am 20.03.2017 11:59, schrieb Daeseok Youn: > If v4l2_subdev_call() gets the global frame interval values, > it returned 0 and it could be checked whether numerator is zero or not. > > If the numerator is not zero, the fps could be calculated in this function. > If not, it just returns 0. > >

Re: [PATCH] staging: atomisp: clean up return logic, remove redunant code

2017-03-12 Thread walter harms
Am 11.03.2017 20:32, schrieb Colin King: > From: Colin Ian King > > There is no need to check if ret is non-zero, remove this > redundant check and just return the error status from the call > to mt9m114_write_reg_array. > > Detected by CoverityScan, CID#1416577

Re: [PATCH] [media] atmel-isc: fix off-by-one comparison and out of bounds read issue

2017-03-09 Thread walter harms
Am 09.03.2017 11:57, schrieb Hans Verkuil: > Hi Songjun, > > On 08/03/17 03:25, Wu, Songjun wrote: >> Hi Colin, >> >> Thank you for your comment. >> It is a bug, will be fixed in the next patch. > > Do you mean that you will provide a new patch for this? Is there anything > wrong with this

Re: [patch v2] staging: bcm2835-camera: fix error handling in init

2017-02-18 Thread walter harms
returning directly. > > Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera > driver.") > Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> > --- > v2: Change the style to make Walter Harms happy. Fix some additional > bugs I missed in

Re: [patch] staging: bcm2835-camera: free first element in array

2017-02-15 Thread walter harms
Am 15.02.2017 13:25, schrieb Dan Carpenter: > We should free gdev[0] so the > should be >=. > > Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera > driver.") > Signed-off-by: Dan Carpenter > > diff --git

Re: [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init()

2017-01-27 Thread walter harms
Am 27.01.2017 09:06, schrieb Dan Carpenter: > We should be returning negative error codes here or it leads to a crash. > This also silences a static checker warning. > > drivers/media/pci/mantis/mantis_cards.c:250 mantis_pci_probe() > warn: 'mantis->dmxdev.dvbdev->fops' double freed

Re: [patch] [media] uvcvideo: freeing an error pointer

2016-11-25 Thread walter harms
Am 25.11.2016 14:57, schrieb Laurent Pinchart: > Hi Dan, > > Thank you for the patch. > > On Friday 25 Nov 2016 13:28:35 Dan Carpenter wrote: >> A recent cleanup introduced a potential dereference of -EFAULT when we >> call kfree(map->menu_info). > > I should have caught that, my apologies

Re: [PATCH 2/2] [media] dvb-tc90522: Rename a jump label in tc90522_probe()

2016-10-08 Thread walter harms
Am 07.10.2016 21:46, schrieb SF Markus Elfring: > From: Markus Elfring > Date: Fri, 7 Oct 2016 21:13:57 +0200 > > Adjust a jump label according to the Linux coding style convention. > > Signed-off-by: Markus Elfring > --- >

Re: [PATCH] [media] v4l2-common: Delete an unnecessary check before the function call "spi_unregister_device"

2016-07-19 Thread walter harms
Am 19.07.2016 20:02, schrieb SF Markus Elfring: > From: Markus Elfring > Date: Tue, 19 Jul 2016 19:54:16 +0200 > > The spi_unregister_device() function tests whether its argument is NULL > and then returns immediately. Thus the test around the call is not needed.

Re: [PATCH 2/2] [media] c8sectpfe: Combine three checks into a single if block

2015-11-06 Thread walter harms
Am 05.11.2015 19:50, schrieb SF Markus Elfring: > From: Markus Elfring > Date: Thu, 5 Nov 2015 19:23:50 +0100 > > The variable "tsin" was checked three times in a loop iteration of the > c8sectpfe_tuner_unregister_frontend() function. > This implementation detail

Re: [PATCH v2] [media] mantis: fix error handling

2015-03-22 Thread walter harms
Am 22.03.2015 18:16, schrieb Silvan Jegen: Remove dead code, make goto label names more expressive and add a label in order to call mantis_dvb_exit if mantis_uart_init fails. Also make sure that mantis_pci_exit is called if we fail the mantis_stream_control call and that we call

Re: [patch] [media] coda: improve safety in coda_register_device()

2015-01-08 Thread walter harms
Am 08.01.2015 11:07, schrieb Dan Carpenter: The i variable is used as an offset into both the dev-vfd[] and the dev-devtype-vdevs[] arrays. The second array is smaller so we should use that as a limit instead of ARRAY_SIZE(dev-vfd). Also the original check was off by one. We should use

Re: [patch v2] [media] stv090x: remove indent levels in stv090x_get_coldlock()

2014-02-21 Thread walter harms
Am 21.02.2014 09:50, schrieb Dan Carpenter: This code is needlessly complicated and checkpatch.pl complains that we go over the 80 characters per line limit. If we flip the if (!lock) { test to if (lock) return; then we can remove an indent level from the rest of the function. We can

Re: [PATCH] trivial: adjust code alignment

2013-08-05 Thread walter harms
Hello Julia, IMHO keep the patch as it is. It does not change any code that is good. Suspicious code that comes up here can be addressed in a separate patch. just my 2 cents, re, wh Am 05.08.2013 18:19, schrieb Julia Lawall: On Mon, 5 Aug 2013, Dan Carpenter wrote: On Mon, Aug 05, 2013 at

Re: [patch] [media] bt8xx: info leak in ca_get_slot_info()

2013-07-25 Thread walter harms
Am 25.07.2013 18:46, schrieb Dan Carpenter: p_ca_slot_info was allocated with kmalloc() so we need to clear it before passing it to the user. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/media/pci/bt8xx/dst_ca.c b/drivers/media/pci/bt8xx/dst_ca.c index

Re: [patch] [media] media: info leak in media_device_enum_entities()

2013-04-21 Thread walter harms
Am 21.04.2013 13:10, schrieb Dan Carpenter: The last part of the u_ent.name buffer isn't cleared so it still has uninitialized stack memory. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread walter harms
Am 07.10.2012 17:38, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg structure, a length expressed as an explicit constant is also re-expressed as the size of the buffer, reg. A simplified

Re: [PATCH 9/13] drivers/media/tuners/fc0011.c: use macros for i2c_msg initialization

2012-10-07 Thread walter harms
Am 07.10.2012 17:38, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re-expressed as the size of the buffer in each case. A simplified version of the semantic

Re: [PATCH 9/13] drivers/media/tuners/fc0011.c: use macros for i2c_msg initialization

2012-10-07 Thread walter harms
Am 07.10.2012 18:50, schrieb Julia Lawall: On Sun, 7 Oct 2012, walter harms wrote: Am 07.10.2012 17:38, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. A length expressed as an explicit constant is also re

Re: [PATCH 13/13] drivers/media/tuners/e4000.c: use macros for i2c_msg initialization

2012-10-07 Thread walter harms
Am 07.10.2012 18:44, schrieb Julia Lawall: On Sun, 7 Oct 2012, walter harms wrote: Am 07.10.2012 17:38, schrieb Julia Lawall: From: Julia Lawall julia.law...@lip6.fr Introduce use of I2c_MSG_READ/WRITE/OP, for readability. In the second i2c_msg structure, a length expressed

Re: [patch] [media] cx25821: testing the wrong variable

2012-09-29 Thread walter harms
Am 29.09.2012 09:12, schrieb Dan Carpenter: -input_filename could be NULL here. The intent was to test -_filename. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- I'm not totally convinced that using /root/vid411.yuv is the right idea. diff --git

Re: [PATCH v2] drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c: fix error return code

2012-09-09 Thread walter harms
looks ok to me, note: i do not have the hardware Reviewed-by: walter harms wha...@bfs.de Am 08.09.2012 16:01, schrieb Peter Senna Tschudin: From: Peter Senna Tschudin peter.se...@gmail.com Convert a nonnegative error return code to a negative one, as returned elsewhere in the function

Re: [patch v2] [media] rc-core: prevent divide by zero bug in s_tx_carrier()

2012-09-09 Thread walter harms
Hi all, I am not sure if that is a good idea. it should be in the hands of the driver who to use these 'val' some driver may need a higher value like this one: static int iguanair_set_tx_carrier(struct rc_dev *dev, uint32_t carrier) { struct iguanair *ir = dev-priv; if (carrier

Re: [patch] [media] ngene: remove an unneeded condition

2012-04-28 Thread walter harms
Am 20.04.2012 15:15, schrieb Dan Carpenter: stat is always zero here. The condition used to be needed, but we shifted stuff around in 0f0b270f90 [media] ngene: CXD2099AR Common Interface driver. This doesn't change how the code works, it's just a bit tidier. Signed-off-by: Dan

Re: [PATCH] [media] staging: use mutex_lock() in s2250_probe().

2012-03-18 Thread walter harms
Am 17.03.2012 18:36, schrieb santosh nayak: From: Santosh Nayak santoshprasadna...@gmail.com Use uninterruptable sleep lock 'mutex_lock()' in place of mutex_lock_interruptible() because there is no userspace for s2250_probe(). Return -ENOMEM if kzalloc() fails to allocate and

Re: [patch 2/2] [media] ds3000: off by one in ds3000_read_snr()

2012-01-19 Thread walter harms
Am 19.01.2012 10:33, schrieb Dan Carpenter: On Wed, Jan 18, 2012 at 06:06:46PM +0100, walter harms wrote: Am 17.01.2012 08:30, schrieb Dan Carpenter: This is a static checker patch and I don't have the hardware to test this, so please review it carefully. The dvbs2_snr_tab[] array has 80

Re: [patch] [media] DVB: dvb_frontend: off by one in dtv_property_dump()

2011-06-04 Thread walter harms
Am 04.06.2011 15:36, schrieb Mauro Carvalho Chehab: Em 26-05-2011 08:16, Andreas Oberritter escreveu: Hi Dan, On 05/26/2011 10:44 AM, Dan Carpenter wrote: If the tvp-cmd == DTV_MAX_COMMAND then we read past the end of the array. Signed-off-by: Dan Carpenter erro...@gmail.com diff --git

Re: [patch] V4L/DVB: dvb_ca_en50221: return -EFAULT on copy_to_user errors

2010-06-04 Thread walter harms
Dan Carpenter schrieb: copy_to_user() returns the number of bytes remaining to be copied which isn't the right thing to return here. The comments say that these functions in dvb_ca_en50221.c should return the number of bytes copied or an error return. I've changed it to return -EFAULT.

Re: [patch -next 1/2] media/az6027: doing dma on the stack

2010-05-04 Thread walter harms
Dan Carpenter schrieb: I changed the dma buffers to use allocated memory instead of stack memory. The reason for this is documented in Documentation/DMA-API-HOWTO.txt under the section: What memory is DMA'able? That document was only added a couple weeks ago and there are still lots of