Re: [PATCH] Staging: media: omap4iss: Use WARN_ON() instead of BUG_ON().

2017-09-08 Thread Dan Carpenter
truct iss_device *iss) > return; > > mutex_lock(>iss_mutex); > - BUG_ON(iss->ref_count == 0); > + WARN_ON(iss->ref_count == 0); ref_counting bugs often have a security aspect. BUG_ON() is probably safer here. Better to crash than to lose all your bitcoin. regards, dan carpenter

[bug report] media: v4l2-flash-led-class: Create separate sub-devices for indicators

2017-08-29 Thread Dan Carpenter
h_strobe(fled_cdev, false); ^ but we had an old unchecked dereference here. 211 case V4L2_FLASH_LED_MODE_FLASH: 212 /* Turn the torch LED off */ regards, dan carpenter

[PATCH 1/2] [media] dib9000: delete some unused broken code

2017-08-26 Thread Dan Carpenter
end of the list. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/dvb-frontends/dib9000.h b/drivers/media/dvb-frontends/dib9000.h index b10a70aa7c9f..40883b41e66b 100644 --- a/drivers/media/dvb-frontends/dib9000.h +++ b/drivers/media/dvb-frontends/di

[PATCH 2/2] [media] dib8000: remove some bogus dead code

2017-08-26 Thread Dan Carpenter
This function is broken. It sets the wrong front_end to NULL. But it's not used, so let's just delete it. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/dvb-frontends/dib8000.h b/drivers/media/dvb-frontends/dib8000.h index 2b8b4b1656a2..75cc8e47ec8f

[PATCH] [media] staging: atomisp: fix bounds checking in mt9m114_s_exposure_selection()

2017-08-10 Thread Dan Carpenter
These clamp_t() calls are no-ops because we don't save the results. It leads to an array out of bounds bug. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/atomi

[bug report] v4l: vsp1: Add support for the BRS entity

2017-08-09 Thread Dan Carpenter
^^^ Patch adds new unchecked dereference. 457 ? VI6_WPF_SRCRPF_VIRACT_MST 458 : VI6_WPF_SRCRPF_VIRACT2_MST; regards, dan carpenter

[PATCH] [media] adv7604: Prevent out of bounds access

2017-08-04 Thread Dan Carpenter
shift wrap around to a bit which is set. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 660bacb8f7d9..8c633b8f30e7 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -618,7 +618,

Re: [PATCH] Staging: bcm2048: fix bare use of 'unsigned' in radio-bcm2048.c

2017-08-03 Thread Dan Carpenter
This breaks the build. Always try to compile your patches. regards, dan carpenter

Re: [PATCH v2] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-19 Thread Dan Carpenter
Looks good. regards, dan carpenter

[PATCH] [media] atomisp2: array underflow in ap1302_enum_frame_size()

2017-07-19 Thread Dan Carpenter
ve values of "index" to be treated as -EINVAL but they're not so we can read from before the start of the res_table[] array. I've fixed this by making "res_num" a u32. I made "cur_res" a u32 as well, just for consistency. Fixes: a49d25364dfb ("staging/ato

[PATCH] [media] atomisp2: array underflow in imx_enum_frame_size()

2017-07-19 Thread Dan Carpenter
so we don't read before the start of the dev->curr_res_table[] array. I've made "entries_curr_table" unsigned long to fix this. I thought about making it unsigned int, but because of struct alignment, it doesn't use more memory either way. Fixes: a49d25364dfb ("staging/atomisp: A

[PATCH] [media] atomisp2: Array underflow in atomisp_enum_input()

2017-07-19 Thread Dan Carpenter
VAL; "input->index" is a u32 which comes from the ioctl. We want negative values of "index" to be counted as -EINVAL but they aren't. I've fixed this by changing the type of "isp->input_cnt" to unsigned int. Fixes: a49d25364dfb ("staging/atomisp:

Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-17 Thread Dan Carpenter
t' > > wouldn't > > break something. > > I think Dan was recommending the opposite here, if I understood you > both correctly: > he said we should propagate the error code unless we know it's wrong, while > you > want to keep the current behavior to avoid introducing changes ;-) > I don't know the subsystem rules at all, so don't listen to me. regards, dan carpenter

[PATCH] atomisp: array underflow in ioctl

2017-07-17 Thread Dan Carpenter
ey aren't. There are several ways to fix this but I feel like the best fix for future proofing is to change the type of N_RES from int to unsigned long to make it the same as if we were comparing against ARRAY_SIZE(). Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/driver

Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Dan Carpenter
On Fri, Jul 14, 2017 at 03:55:26PM +0300, Dan Carpenter wrote: > I don't agree with it as a static analysis dev... What I mean is if it's a macro that returns -ENODEV or a function that returns -ENODEV, they should both be treated the same. The other warnings this check prints are quite cle

Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Dan Carpenter
Ah... I see why it's complaining about these ones in particular... I don't agree with it as a static analysis dev, and I don't like the changes too much. But since it's only generating a hand full of warnings then I don't care. regards, dan carpenter

Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Dan Carpenter
Y8_2X8) 1175 bridge = ISPCTRL_PAR_BRIDGE_BENDIAN; 1176 else 1177 bridge = ISPCTRL_PAR_BRIDGE_DISABLE; 1178 1179 omap3isp_configure_bridge(isp, ccdc->input, parcfg, shift, bridge); regards, dan carpenter

Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-14 Thread Dan Carpenter
real bugs. Just disable it. Changing the code to propagate error codes, is the right thing of course so long as it doesn't introduce bugs. regards, dan carpenter

[bug report] [media] davinci: vpif_capture: get subdevs from DT when available

2017-07-11 Thread Dan Carpenter
598 pdata->card_name = "DA850/OMAP-L138 Video Capture"; 1599 1600 return pdata; 1601 } regards, dan carpenter

[bug report] media: v4l: omap_vout: vrfb: Convert to dmaengine

2017-06-29 Thread Dan Carpenter
n about this. 274 if (tx == NULL) { 275 pr_err("%s: DMA interleaved prep error\n", __func__); 276 return -EINVAL; regards, dan carpenter

[PATCH] atomisp2: off by one in atomisp_s_input()

2017-05-22 Thread Dan Carpenter
ning -EINVAL a few lines later because the .camera pointer is NULL. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_ioctl.c index 6064bb823a47..a

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

2017-05-15 Thread Dan Carpenter
On Mon, May 15, 2017 at 12:21:45PM +0200, walter harms wrote: > can this strcpy_s() replaced with strlcpy ? > These functions obviously should be removed, yes. Please send a patch for that and we can drop my patches. Give David reported-by credit. regards, dan carpenter

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

2017-05-15 Thread Dan Carpenter
pport for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/hive_isp_css_include/string_support.h in

[PATCH 1/2] staging/atomisp: one char read beyond end of string

2017-05-15 Thread Dan Carpenter
We should verify that "ix < max_len" before we test whether we have reached the NUL terminator. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Reported-by: David Binderman <dcb...@hotmail.com> Signed-off-by: Dan Carpenter <dan.c

Re: [PATCH 1/2] staging/atomisp: one char read beyond end of string

2017-05-15 Thread Dan Carpenter
Oops. Please ignore this one. I meant to send it to David Binderman's thread. regards, dan carpenter

[PATCH 1/2] staging/atomisp: one char read beyond end of string

2017-05-15 Thread Dan Carpenter
We should verify that "ix < max_len" before we test whether we have reached the NUL terminator. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Reported-by: David Binderman <dcb...@hotmail.com> Signed-off-by: Dan Carpenter <dan.c

Re: [PATCH] Fix spaces ERROR in atomisp_gmin_platform.c

2017-05-07 Thread Dan Carpenter
, > + port, lanes, bayer_order); This introduces a checkpatch.pl warning. Do it like this: [tab][tab][tab][space]"camera pdata: port: %d lanes: %d order: %8.8x\n", regards, dan carpenter

Re: [PATCH] staging/media/atomisp/platform/intel-mid change spaces to tabs and comma/assignment space padding

2017-05-05 Thread Dan Carpenter
in_subdev *gs; > -struct i2c_client *client = v4l2_get_subdevdata(subdev); > + struct i2c_client *client = v4l2_get_subdevdata(subdev); Wut? How would this be correct? regards, dan carpenter

Re: [V1] staging : media : fixed macro expansion error

2017-05-05 Thread Dan Carpenter
size, mask, check) > \ > +property_read(prop, size, mask)) breaks the build. regards, dan carpenter

[PATCH] staging/atomisp: fix && vs || typos

2017-04-28 Thread Dan Carpenter
These sanity checks don't work because they use && instead of ||. It's impossible to be both negative and greater than 5. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drive

[PATCH 1/2] [media] dib0700: fix locking in dib0700_i2c_xfer_new()

2017-04-28 Thread Dan Carpenter
This patch mostly adds unlocks to error paths. But one additional small change is that I made the first "break;" a "goto unlock;" which means that now we return failure instead of success on that path. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --g

[PATCH 2/2] [media] dib0700: fix error handling in dib0700_i2c_xfer_legacy()

2017-04-28 Thread Dan Carpenter
Mostly this adds some unlocks to error paths. But, if you see where there were "break;" statements before, I changed those paths to return error codes instead of returning success. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/usb/dvb-usb/d

Re: [PATCH 1/2] [media] vb2: Fix an off by one error in 'vb2_plane_vaddr'

2017-04-25 Thread Dan Carpenter
mework") Fixes tags are always good too have btw. You should be adding them by default to everything even if it doesn't get backported to stable. regards, dan carpenter

[bug report] [media] vp702x: comment dead code

2017-04-13 Thread Dan Carpenter
default: 142 break; 143 } regards, dan carpenter

Re: [PATCH] drivers/staging/media: atomisp: Removing redundant information from dev_err

2017-03-24 Thread Dan Carpenter
c failed!\n", __func__); > + dev_err(atomisp_dev, "%s: failed!\n", __func__); The whole printk can be removed. kmem_cache_alloc() has its own better printks. regards, dan carpenter

Re: [PATCH] staging: radio-bcm2048: Fix checkpatch warnings: WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

2017-03-20 Thread Dan Carpenter
Also fix your From header. regards, dan carpenter

Re: [PATCH] staging: radio-bcm2048: Fix checkpatch warnings: WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

2017-03-20 Thread Dan Carpenter
The subject is too long. On Mon, Mar 20, 2017 at 10:02:33PM +1100, unknown wrote: > Signed-off-by: Eddie Youseph <psyblas...@gmail.com> You need to have a changelog. regards, dan carpenter

Re: [PATCH 3/4] staging: atomisp: remove useless condition in if-statements

2017-03-20 Thread Dan Carpenter
if-statement > has the condition to check whether the css_pipe_id equals to > 'CSS_PIPE_ID_COPY' or not. It should be removed. > > Signed-off-by: Daeseok Youn <daeseok.y...@gmail.com> The patch is correct but the changelog is not. s/CSS_PIPE_ID_COPY/CSS_PIPE_ID_YUVPP/ regards, dan carpenter

[PATCH] Staging: atomisp: fix locking in alloc_user_pages()

2017-03-17 Thread Dan Carpenter
We call this function with the lock held and should also return with the lock held as well. This one error path is not-consistent because we should return without the lock held. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/atomisp/pci/atomis

[PATCH] Staging: atomisp: fix an uninitialized variable bug

2017-03-17 Thread Dan Carpenter
There are some error paths in atomisp_css_frame_allocate() which don't initialize "res" so it could lead us to try release random memory. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> di

[PATCH] staging: atomicsp: fix a loop timeout

2017-03-14 Thread Dan Carpenter
It's a post-op loop so we timeout with "max_wait" set to -1, not 0. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.

[patch] staging: atomisp: missing break statement in switch

2017-03-14 Thread Dan Carpenter
Static analysis tools suggest that we probably want a break statement here before then next cast statement. Looks true to me. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drive

[PATCH] staging: atomisp: silence an array overflow warning

2017-03-14 Thread Dan Carpenter
Static checkers complain that we should check if "i" is in bounds before we check if "var8[i]" is a NUL char. This bug is harmless but also easy to fix. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/atomisp/platform/intel-m

[patch] Staging: atomisp: kfreeing a devm allocated pointer

2017-03-14 Thread Dan Carpenter
We shouldn't pass devm allocated pointers to kfree() or it leads to a double free. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/atomisp/i2c/imx/otp_brcc064_e2p

[PATCH] staging: atomisp: off by one in atomisp_acc_load_extensions()

2017-03-14 Thread Dan Carpenter
We should be doing i-- on all error paths but we don't if the loop finishes successfully. I've re-arranged this so that we don't read beyond the end of acc_flag_to_pipe[] array. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter &

[patch] staging/atomisp: silence uninitialized variable warnings

2017-03-14 Thread Dan Carpenter
These print an uninitialized value for "opt". Let's just remove the printk. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_drvfs.c in

[bug report] staging/atomisp: Add support for the Intel IPU v2

2017-03-13 Thread Dan Carpenter
s impossible. Was UINT_MAX intended? 677 return -EINVAL; 678 regards, dan carpenter

[PATCH] staging: atomisp: potential underflow in atomisp_get_metadata_by_type()

2017-03-13 Thread Dan Carpenter
md_type is an enum. On my tests, GCC treats it as unsigned but according to the C standard it's an implementation dependant thing so we should check for negatives. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter <dan.carpen.

Re: [PATCH] staging: atomisp: use k{v}zalloc instead of k{v}alloc and memset

2017-03-13 Thread Dan Carpenter
; (vzalloc is for same reason with kzalloc) > > And also atomisp_kernel_malloc() can be used with > atomisp_kernel_zalloc(, false); > We should just change all the callers to kvmalloc() and kvzmalloc(). regards, dan carpenter

Re: [bug report] [media] atmel-isc: add the isc pipeline function

2017-03-07 Thread Dan Carpenter
No. Imagine the v4l2_subdev_call() loop exits with "fmt" set to NULL. It will cause a crash. Please re-read my original email because I think you may have meant to reset fmt after that loop. regards, dan carpenter

[bug report] [media] atmel-isc: add the isc pipeline function

2017-03-06 Thread Dan Carpenter
num_fmts++; 1496 1497 fmt++; 1498 } 1499 1500 if (!num_fmts) 1501 return -ENXIO; regards, dan carpenter

Re: [PATCH] Staging: media: platform: bcm2835 - Style fix

2017-03-06 Thread Dan Carpenter
On Sun, Mar 05, 2017 at 10:43:19AM +1300, Derek Robson wrote: > On Sat, Mar 04, 2017 at 02:57:22PM +0300, Dan Carpenter wrote: > > Copy a patch prefix that everyone else has been using: > > > > git log --oneline drivers/staging/media/platform/bcm2835/ > > > >

Re: [PATCH] Staging: media: platform: bcm2835 - Style fix

2017-03-04 Thread Dan Carpenter
Copy a patch prefix that everyone else has been using: git log --oneline drivers/staging/media/platform/bcm2835/ The subject is too vague as well. regards, dan carpenter

Re: [RFC PATCH 04/12] staging: android: ion: Call dma_map_sg for syncing and mapping

2017-03-03 Thread Dan Carpenter
gt; + } > + > +err: > + free_duped_table(table); > + return ERR_PTR(ret); ret isn't initialized on success. > } > regards, dan carpenter

Re: [PATCH] staging: bcm2835: Fix a memory leak in error handling path

2017-02-24 Thread Dan Carpenter
On Fri, Feb 24, 2017 at 10:38:38PM +0100, Stefan Wahren wrote: > > > Dan Carpenter <dan.carpen...@oracle.com> hat am 24. Februar 2017 um 20:57 > > geschrieben: > > > > > > On Fri, Feb 24, 2017 at 01:37:30PM +0100, Stefan Wahren wrote: > > > Hi

Re: [PATCH] staging: bcm2835: Fix a memory leak in error handling path

2017-02-24 Thread Dan Carpenter
n't checked your patch yet. It takes like 30 seconds to review this patch. Do you use mutt? I have a macro that applies patches and loads vim at the right line. regards, dan carpenter

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

2017-02-17 Thread Dan Carpenter
The unwinding here isn't right. We don't free gdev[0] and instead free 1 step past what was allocated. Also we can't allocate "dev" then we should unwind instead of returning directly. Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver."

[patch] staging: bcm2835/mmal-vchiq: unlock on error in buffer_from_host()

2017-02-17 Thread Dan Carpenter
We should unlock before returning on this error path. Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/platform/bcm2835/mmal-vchiq.c b/drivers/stagin

Re: [PATCH] [media] Staging: media/lirc: don't call put_ir_rx on rx twice

2017-02-17 Thread Dan Carpenter
. regards, dan carpenter

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

2017-02-16 Thread Dan Carpenter
On Wed, Feb 15, 2017 at 01:47:55PM +0100, walter harms wrote: > > > 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 > >

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

2017-02-15 Thread 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 <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/platform/bcm2835/bcm2835-camera.c b/drivers/staging/

[bug report] [media] st-delta: add mjpeg support

2017-02-13 Thread Dan Carpenter
eader, _offset); 410 if (ret) { 411 pctx->stream_errors++; 412 goto err; 413 } 414 415 au.paddr += data_offset; ^^^^^^^ 416 au.vaddr += data_offset; regards, dan carpenter

Re: [PATCH] staging:bcm2048 : Add parentheses around variable x

2017-02-03 Thread Dan Carpenter
On Sat, Dec 03, 2016 at 03:14:26PM +0530, Tabrez khan wrote: > Add parentheses around variable x for the readability purpose. > It's not really about readability... regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the b

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

2017-01-27 Thread Dan Carpenter
You're, of course, correct that this code could be cleaned up... regards, dan carpenter -- 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/majordomo-info.html

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

2017-01-27 Thread 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 Signed-off-by: Dan Carpenter <d

Re: [PATCH 4/8] [media] videobuf-dma-sg: Adjust 24 checks for null values

2017-01-09 Thread Dan Carpenter
ion checks without it. Generally lengths are numbers and not booleans so "len == 0" is ok. Checkpatch doesn't complain about that. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel

Re: [media] bt8xx: One function call less in bttv_input_init() after error detection

2016-12-12 Thread Dan Carpenter
You will never win an ELIZA bot challenge against Markus. :P I admire your optimism though. regards, dan carpenter -- 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.

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

2016-11-30 Thread Dan Carpenter
rically just from looking at which code has the most bugs, then single exit labels are the most buggy. regards, dan carpenter -- 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/majordomo-info.html

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

2016-11-30 Thread Dan Carpenter
On Mon, Nov 28, 2016 at 04:49:36PM +0200, Laurent Pinchart wrote: > Hi Julia and Dan, > > On Monday 28 Nov 2016 14:54:58 Julia Lawall wrote: > > On Mon, 28 Nov 2016, Dan Carpenter wrote: > > > I understand the comparison, but I just think it's better if people > > &

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

2016-11-28 Thread Dan Carpenter
ren't allocated"... It's garbage code. But I understand that other people don't agree. regards, dan carpenter -- 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/majordomo-info.html

[bug report] [media] lirc: prevent use-after free

2016-11-26 Thread Dan Carpenter
This is a double free, isn't it? It should just be goto del_cdev; 182 goto err_out; 183 } 184 185 ir->cdev = cdev; 186 187 return 0; 188 189 err_out: 190 cdev_del(cdev); Can't pass NULLs to this function. 19

[patch] [media] media: ti-vpe: vpdma: fix a timeout loop

2016-11-25 Thread Dan Carpenter
APIs") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/platform/ti-vpe/vpdma.c b/drivers/media/platform/ti-vpe/vpdma.c index 13bfd71..23472e3 100644 --- a/drivers/media/platform/ti-vpe/vpdma.c +++ b/drivers/media/platform/ti-vpe/vpdma.c @@ -453

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

2016-11-25 Thread Dan Carpenter
That honestly seems like a simple rule to me, whenever I touch error handling code it feels better and simpler after I fix the bugs. Error handling doesn't have to be complicated if you just follow the rules. regards, dan carpenter -- To unsubscribe from this list: send the line &qu

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

2016-11-25 Thread Dan Carpenter
patch. Feel free to send it. ;) regards, dan carpenter -- 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/majordomo-info.html

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

2016-11-25 Thread Dan Carpenter
A recent cleanup introduced a potential dereference of -EFAULT when we call kfree(map->menu_info). Fixes: 4cc5bed1caeb ("[media] uvcvideo: Use memdup_user() rather than duplicating its implementation") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/dr

[patch] Staging: media: davinci_vpfe: unlock on error in vpfe_reqbufs()

2016-11-18 Thread Dan Carpenter
We should unlock before returning this error code in vpfe_reqbufs(). Fixes: 622897da67b3 ("[media] davinci: vpfe: add v4l2 video driver support") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drive

[patch v2] [media] stk-webcam: fix an endian bug in stk_camera_read_reg()

2016-11-16 Thread Dan Carpenter
We pass an int pointer to stk_camera_read_reg() but only write to the highest byte. It's a bug on big endian systems and generally a nasty thing to do and doesn't match the write function either. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- v2: I forgot to update stk-se

[patch] [media] stk-webcam: fix an endian bug in stk_camera_read_reg()

2016-11-15 Thread Dan Carpenter
We pass an int pointer to stk_camera_read_reg() but only write to the highest byte. It's a bug on big endian systems and generally a nasty thing to do and doesn't match the write function either. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/usb/stk

Re: [bug report] [media] dib0700_core: don't use stack on I2C reads

2016-11-14 Thread Dan Carpenter
usb/dvb-usb/dib0700_core.c:338 dib0700_i2c_xfer_legacy() warn: inconsistent returns 'mutex:>usb_mutex'. Locked on: line 301 line 322 Unlocked on: line 287 line 291 line 338 regards, dan carpenter -- To unsubscribe from this list: send th

[bug report] [media] dib0700_core: don't use stack on I2C reads

2016-11-14 Thread Dan Carpenter
if (result < 0) { 270 deb_info("i2c write error (status = %d)\n", result); 271 break; 272 } 273 } 274 } 275 mutex_unlock(>i2c_mutex); 276 return i; 277 } regards, dan carpenter -- 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/majordomo-info.html

Re: [bug report] [media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver

2016-11-10 Thread Dan Carpenter
On Wed, Nov 09, 2016 at 02:45:21PM +0100, Hans Verkuil wrote: > On 11/09/16 14:28, Dan Carpenter wrote: > >Hello Tiffany Lin, > > > >The patch 590577a4e525: "[media] vcodec: mediatek: Add Mediatek V4L2 > >Video Decoder Driver" from Sep 2, 2016, leads to th

[bug report] [media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver

2016-11-09 Thread Dan Carpenter
%d) vb=%p", 544 ctx->id, buf->type, buf->index, 545 mtkbuf->lastframe, buf->bytesused, 546 buf->m.planes[0].bytesused, buf->length, 547 vb); 548

Re: [PATCH 3/3] [media] au0828-video: Move two assignments in au0828_init_isoc()

2016-10-25 Thread Dan Carpenter
This patch introduces bugs. It's my policy to not explain the Markus's bugs because otherwise he will just resend the patchset and I have asked him many times to stop. I will happily review bug fix patches but I really think he should stop sending these cleanup patches. regards, dan carpenter

Re: [PATCH 1/3] [media] au0828-video: Use kcalloc() in au0828_init_isoc()

2016-10-25 Thread Dan Carpenter
On Mon, Oct 24, 2016 at 10:59:24PM +0200, SF Markus Elfring wrote: > + dev->isoc_ctl.transfer_buffer = kcalloc(num_bufs, > + sizeof(*dev->isoc_ctl > +.transfer_buffer), This is ugly

Re: [PATCH 02/18] [media] RedRat3: Move two assignments in redrat3_transmit_ir()

2016-10-14 Thread Dan Carpenter
I have asked you about six or seven times to only send bug fixes and stop sending clean up patches. You have refused. But now I'm asking you to stop randomly doing things without at least thinking about it for a bit. The original code was correct. regards, dan carpenter -- To unsubscribe from

[patch] [media] st-hva: fix some error handling in hva_hw_probe()

2016-10-14 Thread Dan Carpenter
video encoder V4L2 driver") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/platform/sti/hva/hva-hw.c b/drivers/media/platform/sti/hva/hva-hw.c index d341d49..cf2a8d8 100644 --- a/drivers/media/platform/sti/hva/hva-hw.c +++ b/drivers/media/platform/

Re: Staging: Media: Lirc - Fix possible ERR_PTR() dereferencing.

2016-09-20 Thread Dan Carpenter
.com> > Signed-off-by: Shailendra Verma <shailendr...@samsung.com> Calling kfree(NULL) is fine so there is no bug in the original code. Also this patch creates a new locking bug. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-media&

[patch] [media] blackfin: check devm_pinctrl_get() for errors

2016-07-14 Thread Dan Carpenter
devm_pinctrl_get() can fail so we should check for that. Fixes: 0a6824bc10de ('[media] v4l2: blackfin: select proper pinctrl state in ppi_set_params if CONFIG_PINCTRL is enabled') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/platform/blackfin/pp

[bug report] [media] cec-funcs.h: static inlines to pack/unpack CEC messages

2016-07-05 Thread Dan Carpenter
len = 13; 1159 memcpy(osd, msg->msg + 3, len); 1160 osd[len] = '\0'; 1161 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo

re: [media] cec: add HDMI CEC framework (adapter)

2016-06-29 Thread Dan Carpenter
for logical address %d\n", 1448 adap->phys_addrs[init_laddr], init_laddr); 1449 break; 1450 1451 case CEC_MSG_USER_CONTROL_PRESSED: regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-

[patch] [media] dvb-usb: silence an uninitialized variable warning

2016-06-27 Thread Dan Carpenter
a] dvb core: must check dvb_create_media_graph()'). Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c b/drivers/media/usb/dvb-usb/dvb-usb-dvb.c index 6477b04..a04c0a2 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/usb/dvb-usb/d

[patch] media: s5p-mfc: fix a couple double frees in probe

2016-06-11 Thread Dan Carpenter
The extra calls to video_device_release() are a bug, we free these after the goto. Fixes: c974c436eaf4 ('s5p-mfc: Fix race between s5p_mfc_probe() and s5p_mfc_open()') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- This code would be easier to understand if it didn't use &quo

[patch v2][media] em28xx-i2c: rt_mutex_trylock() returns zero on failure

2016-05-09 Thread Dan Carpenter
The code is checking for negative returns but it should be checking for zero. Fixes: aab3125c43d8 ('[media] em28xx: add support for registering multiple i2c buses') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Use different error code. diff --git a/drivers/media/usb/em28xx/

Re: [patch] [media] tw686x: off by one bugs in tw686x_fields_map()

2016-04-27 Thread Dan Carpenter
On Wed, Apr 27, 2016 at 07:31:59AM -0300, Mauro Carvalho Chehab wrote: > I don't like magic numbers, but, in this very specific case, setting > frames per second (fps) var to 25 or 30 makes much more sense. Fine fine. I buy that rationale. regards, dan carpenter -- To unsubscrib

[patch] [media] tw686x: off by one bugs in tw686x_fields_map()

2016-04-27 Thread Dan Carpenter
The > ARRAY_SIZE() should be >= ARRAY_SIZE(). Also this is a slightly unrelated cleanup but I replaced the magic numbers 30 and 25 with ARRAY_SIZE() - 1. Fixes: 363d79f1d5bd ('[media] tw686x: Don't go past array') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --g

[patch] [media] cx231xx: silence uninitialized variable warning

2016-04-22 Thread Dan Carpenter
We print an uninitialized "actlen" variable on the error path. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c index f497888..6741fd0 100644 --- a/drivers/media/usb/cx231x

re: file (standard input) matches

2016-04-21 Thread Dan Carpenter
= id; 883 return 0; 884 } regards, dan carpenter -- 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/majordomo-info.html

re: [PATCH] v4l: 790: added support for terratec cinergy 250 usb

2016-04-21 Thread Dan Carpenter
TYPE_UNKNOWN; 104 *scancode = b; 105 return 1; 106 } regards, dan carpenter -- 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/majordomo-info.html

re: [media] tw9910: init priv->scale and update standard

2016-03-24 Thread Dan Carpenter
539 ret = i2c_smbus_write_byte_data(client, VDELAY_LO, 540 vdelay & 0xff); 541 if (!ret) 542 ret = i2c_smbus_write_byte_data(client, VACTIVE_LO, 543 vact & 0xff); 544 545

[patch] [media] m5mols: potential uninitialized variable

2016-03-15 Thread Dan Carpenter
Smatch complains that there are some paths where "status" isn't initialized. The code does assume that m5mols_read_u8() can fail so it seems as if Smatch is correct. Let's initialize it to REG_ISO_AUTO which is zero. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff

<    1   2   3   4   5   6   7   >