[PATCH 2/2] [media] rc: Fix double free in gpio_ir_recv_remove()

2012-10-28 Thread Jesper Juhl
Since rc_unregister_device() frees its argument there's no need to subsequently call rc_free_device() on the same variable - in fact it's a double free bug. Easily fixed by just removing the rc_free_device() call. Signed-off-by: Jesper Juhl --- drivers/media/rc/gpio-ir-recv.c |1

[PATCH 1/2] [media] rc: Fix double free in gpio_ir_recv_probe()

2012-10-28 Thread Jesper Juhl
e call to rc_free_device() to after rc_unregister_device(). That fixes the problem since rc_free_device() just does nothing if passed NULL and there's no further use of 'rcdev' after the call to rc_free_device() so it's not needed there. Signed-off-by: Jesper Juhl --- driver

[PATCH] [media] s5p-tv: don't include linux/version.h in mixer_video.c

2012-10-18 Thread Jesper Juhl
The header is not needed, so remove it. Signed-off-by: Jesper Juhl --- drivers/media/platform/s5p-tv/mixer_video.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/media/platform/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c index 0c1cd89

Re: [PATCH] [media] stk1160: Check return value of stk1160_read_reg() in stk1160_i2c_read_reg()

2012-10-16 Thread Jesper Juhl
On Mon, 15 Oct 2012, Ezequiel Garcia wrote: > On Mon, Oct 15, 2012 at 9:03 PM, Jesper Juhl wrote: > > On Mon, 15 Oct 2012, Ezequiel Garcia wrote: > > > >> On Mon, Oct 15, 2012 at 7:52 PM, Jesper Juhl wrote: > >> > On Mon, 15 Oct 2012, Jesper Juhl wrote

Re: [PATCH] [media] stk1160: Check return value of stk1160_read_reg() in stk1160_i2c_read_reg()

2012-10-15 Thread Jesper Juhl
On Mon, 15 Oct 2012, Ezequiel Garcia wrote: > On Mon, Oct 15, 2012 at 7:52 PM, Jesper Juhl wrote: > > On Mon, 15 Oct 2012, Jesper Juhl wrote: > > > >> On Sat, 13 Oct 2012, Ezequiel Garcia wrote: > >> [...] > > Currently there are two checks for 'rc

[PATCH] [media] stk1160: Check return value of stk1160_read_reg() in stk1160_i2c_read_reg()

2012-10-15 Thread Jesper Juhl
On Mon, 15 Oct 2012, Jesper Juhl wrote: > On Sat, 13 Oct 2012, Ezequiel Garcia wrote: > > > On Sun, Nov 9, 2008 at 2:04 PM, Jesper Juhl wrote: > > > There are two checks for 'rc' being less than zero with no change to > > > 'rc' between th

Re: [PATCH] [media] stk1160: Remove dead code from stk1160_i2c_read_reg()

2012-10-15 Thread Jesper Juhl
On Sat, 13 Oct 2012, Ezequiel Garcia wrote: > On Sun, Nov 9, 2008 at 2:04 PM, Jesper Juhl wrote: > > There are two checks for 'rc' being less than zero with no change to > > 'rc' between the two, so the second is just dead code - remove it.

[PATCH] [media] stk1160: Remove dead code from stk1160_i2c_read_reg()

2012-10-12 Thread Jesper Juhl
There are two checks for 'rc' being less than zero with no change to 'rc' between the two, so the second is just dead code - remove it. Signed-off-by: Jesper Juhl --- drivers/media/usb/stk1160/stk1160-i2c.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff -

[PATCH][Trivial][resend] Documentation: Add newline at end-of-file to files lacking one

2012-07-20 Thread Jesper Juhl
f output rather than on a new line. B) Some tools that process files line-by-line may get confused by the lack of a newline on the last line. C) The "\ No newline at end of file" line in diffs annoys me for some reason. So, let's just add the missing newline once and for al

[PATCH] [Trivial] Documentation: Add newline at end-of-file to files lacking one

2012-04-16 Thread Jesper Juhl
f output rather than on a new line. B) Some tools that process files line-by-line may get confused by the lack of a newline on the last line. C) The "\ No newline at end of file" line in diffs annoys me for some reason. So, let's just add the missing newline once and for al

[PATCH 20/26] [media] staging: as102: Remove redundant NULL check before release_firmware() and pointless comments

2012-04-09 Thread Jesper Juhl
st stating that add no value. Signed-off-by: Jesper Juhl --- drivers/staging/media/as102/as102_fw.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/media/as102/as102_fw.c b/drivers/staging/media/as102/as102_fw.c index 43ebc43..9db275e 100644 --- a/driver

[PATCH 03/26] [media] s2255drv: Remove redundant NULL test before release_firmware()

2012-04-09 Thread Jesper Juhl
release_firmware() tests for NULL pointers on its own - there's no reason to do an explicit check before calling the function. Signed-off-by: Jesper Juhl --- drivers/media/video/s2255drv.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/video/s2255dr

[PATCH] staging/media/as102: Don't call release_firmware() on uninitialized variable

2012-03-24 Thread Jesper Juhl
are' still uninitialized - not good. The easy fix is to just initialize 'firmware' to NULL when we declare it, since release_firmware() deals gracefully with being passed NULL pointers. Signed-off-by: Jesper Juhl --- drivers/staging/media/as102/as102_fw.c |2 +- 1 file changed,

[PATCH] media, cx231xx: Fix double free on close

2012-03-04 Thread Jesper Juhl
'dev = NULL' assignment at the end of cx231xx_release_resources() since it is pointless. Signed-off-by: Jesper Juhl --- drivers/media/video/cx231xx/cx231xx-cards.c |1 - drivers/media/video/cx231xx/cx231xx-video.c |6 ++ 2 files changed, 2 insertions(+), 5 deletions(-) Please note t

[PATCH][trivial] media, DiB0090: remove redundant ';' from dib0090_fw_identify()

2012-02-26 Thread Jesper Juhl
One semi-colon is enough. Signed-off-by: Jesper Juhl --- drivers/media/dvb/frontends/dib0090.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb/frontends/dib0090.c b/drivers/media/dvb/frontends/dib0090.c index 224d81e..d9fe60b 100644 --- a/drivers/media

Re: [PATCH] tm6000: Don't use pointer after freeing it in tm6000_ir_fini()

2012-02-09 Thread Jesper Juhl
On Mon, 6 Feb 2012, Thierry Reding wrote: > * Jesper Juhl wrote: > > In tm6000_ir_fini() there seems to be a problem. > > rc_unregister_device(ir->rc); calls rc_free_device() on the pointer it is > > given, which frees it. > > > > Subsequently the functi

[PATCH] media, adp1653: Remove unneeded include of version.h from drivers/media/video/adp1653.c

2012-02-02 Thread Jesper Juhl
Signed-off-by: Jesper Juhl --- drivers/media/video/adp1653.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) compile tested only. diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c index 12eedf4..badbdb6 100644 --- a/drivers/media/video/adp1653.c +++ b

[PATCH] staging, media, easycap: Fix mem leak in easycap_usb_probe()

2012-01-29 Thread Jesper Juhl
b_free_urb() before the return. Signed-off-by: Jesper Juhl --- drivers/staging/media/easycap/easycap_main.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) compile tested only diff --git a/drivers/staging/media/easycap/easycap_main.c b/drivers/staging/media/easycap/easycap_main.c

[PATCH] tm6000: Don't use pointer after freeing it in tm6000_ir_fini()

2012-01-28 Thread Jesper Juhl
e does or why. I don't even have a means to test it, so beyond testing that the change compiles it has seen no testing what-so-ever. Anyway, here's a proposed patch. Signed-off-by: Jesper Juhl --- drivers/media/video/tm6000/tm6000-input.c |3 +-- 1 files changed, 1 insertions(

[PATCH] drivers/media/dvb/frontends/drxk_hard.c does not need to include linux/version.h

2012-01-23 Thread Jesper Juhl
This patch removes the unneeded include. Signed-off-by: Jesper Juhl --- drivers/media/dvb/frontends/drxk_hard.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) compile tested only diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index

[PATCH] Remove pointless linux/version.h include from drivers/media/dvb/frontends/tda18271c2dd.c

2012-01-15 Thread Jesper Juhl
As pointed out by 'make versioncheck', there's no need for drivers/media/dvb/frontends/tda18271c2dd.c to #include , so this patch removes the include. Signed-off-by: Jesper Juhl --- drivers/media/dvb/frontends/tda18271c2dd.c |1 - 1 files changed, 0 insertions(+), 1 deletions

[PATCH][Resend] viacam: Don't explode if pci_find_bus() returns NULL

2011-08-01 Thread Jesper Juhl
In the unlikely case that pci_find_bus() should return NULL viacam_serial_is_enabled() is going to dereference a NULL pointer and blow up. Better safe than sorry, so be defensive and check the pointer. Signed-off-by: Jesper Juhl Acked-by: Jonathan Corbet --- drivers/media/video/via-camera.c

[PATCH][Resend] Remove unneeded version.h includes from include/

2011-08-01 Thread Jesper Juhl
l.h +++ b/include/media/pwc-ioctl.h @@ -53,7 +53,6 @@ */ #include -#include /* Enumeration of image sizes */ #define PSZ_SQCIF 0x00 -- 1.7.6 -- Jesper Juhlhttp://www.chaosbits.net/ Don't top-post http://www.catb.org/jargon/html/T/top-post.html Plain text mails only, p

Re: Hauppauge model 73219 rev D1F5 tuner doesn't detect signal, older rev D1E9 works

2011-07-21 Thread Jesper Juhl
On Thu, 21 Jul 2011, Jesper Juhl wrote: > On Tue, 19 Jul 2011, Michael Krufky wrote: > > > On Tue, Jul 19, 2011 at 3:37 AM, Jesper Juhl wrote: > > > Hi > > > > > > I have a bunch of Hauppauge HVR-1900 model 73219's, some are revision D1E9 > >

Re: Hauppauge model 73219 rev D1F5 tuner doesn't detect signal, older rev D1E9 works

2011-07-21 Thread Jesper Juhl
On Tue, 19 Jul 2011, Michael Krufky wrote: > On Tue, Jul 19, 2011 at 3:37 AM, Jesper Juhl wrote: > > Hi > > > > I have a bunch of Hauppauge HVR-1900 model 73219's, some are revision D1E9 > > and work perfectly, but with the newer revision D1F5's the t

Re: Hauppauge model 73219 rev D1F5 tuner doesn't detect signal, older rev D1E9 works

2011-07-19 Thread Jesper Juhl
On Tue, 19 Jul 2011, Michael Krufky wrote: > On Tue, Jul 19, 2011 at 3:37 AM, Jesper Juhl wrote: ... > > I can test any patches you may come up with and if there's any further > > information you need from me in order to get an idea about what the > > problem is, then j

Re: FW: [PATCH] drivers: support new Siano tuner devices.

2011-07-19 Thread Jesper Juhl
edev, u32 pin, > -struct smscore_config_gpio *pinconfig); > -int smscore_set_gpio(struct smscore_device_t *coredev, u32 pin, int > level); > > /* new GPIO management */ > extern int smscore_gpio_configure(struct smscore_device_t *coredev, u8 > PinNum, >

Hauppauge model 73219 rev D1F5 tuner doesn't detect signal, older rev D1E9 works

2011-07-19 Thread Jesper Juhl
black screen). Any ideas on how to fix this? I can test any patches you may come up with and if there's any further information you need from me in order to get an idea about what the problem is, then just ask. Please CC me on replies since I'm not subscribed to the linux-media l

[PATCH] media, Micronas dvb-t: Fix mem leaks, don't needlessly zero mem, fix spelling

2011-07-13 Thread Jesper Juhl
This patch fixes all 3 issues. Signed-off-by: Jesper Juhl --- drivers/media/dvb/frontends/drxd_hard.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb/frontends/drxd_hard.c b/drivers/media/dvb/frontends/drxd_hard.c index f132e49..0266a83 10

[PATCH 6/7] drivers/media: static should be at beginning of declaration

2011-07-09 Thread Jesper Juhl
ned-off-by: Jesper Juhl --- drivers/media/video/omap/omap_vout.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index 4d07c58..a647894 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/dri

[PATCH] viacam: Don't explode if pci_find_bus() returns NULL

2011-07-03 Thread Jesper Juhl
In the unlikely case that pci_find_bus() should return NULL viacam_serial_is_enabled() is going to dereference a NULL pointer and blow up. Better safe than sorry, so be defensive and check the pointer. Signed-off-by: Jesper Juhl --- drivers/media/video/via-camera.c |2 ++ 1 files changed, 2

[PATCH 12/37] Remove unneeded version.h includes (and add where needed) for drivers/media/video/

2011-06-23 Thread Jesper Juhl
It was pointed out by 'make versioncheck' that linux/version.h was not always being included where needed and sometimes included needlessly in drivers/media/video/. This patch fixes up the includes. Signed-off-by: Jesper Juhl --- drivers/media/video/cpia2/cpia2.h|1

[PATCH 11/37] Remove unneeded version.h includes (and add where needed) for drivers/media/radio/

2011-06-23 Thread Jesper Juhl
It was pointed out by 'make versioncheck' that linux/version.h was not always being included where needed and sometimes included needlessly in drivers/media/radio/. This patch fixes up the includes. Signed-off-by: Jesper Juhl --- drivers/media/radio/si470x/radio-si470x-i2c.c |1

[PATCH 10/37] Remove unneeded version.h includes from drivers/media/dvb/

2011-06-23 Thread Jesper Juhl
It was pointed out by 'make versioncheck' that some includes of linux/version.h are not needed in drivers/media/dvb/. This patch removes them. Signed-off-by: Jesper Juhl --- drivers/media/dvb/frontends/drxd_hard.c |1 - drivers/media/dvb/siano/smscoreapi.h|1 - 2 files

[PATCH 03/37] Remove unneeded version.h includes from include/

2011-06-23 Thread Jesper Juhl
It was pointed out by 'make versioncheck' that some includes of linux/version.h were not needed in include/. This patch removes them. Signed-off-by: Jesper Juhl --- include/linux/ceph/messenger.h |1 - include/media/pwc-ioctl.h |1 - 2 files changed, 0 insertions(+), 2

[PATCH][Trivial] Media, DVB, Siano, smsusb: Avoid static analysis report about 'use after free'.

2011-04-21 Thread Jesper Juhl
the code in any way, but it makes the tool shut up. The patch below also removes a rather pointless blank line. Signed-off-by: Jesper Juhl --- smsusb.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c inde

Re: [PATCH][media] DVB, USB, lmedm04: Fix firmware mem leak in lme_firmware_switch()

2011-04-07 Thread Jesper Juhl
On Thu, 7 Apr 2011, Malcolm Priestley wrote: > On Thu, 2011-04-07 at 21:46 +0200, Jesper Juhl wrote: > > Don't leak 'fw' in > > drivers/media/dvb/dvb-usb/lmedm04.c::lme_firmware_switch() by failing to > > call release_firmware(). > > > > Si

[PATCH][media] DVB, USB, lmedm04: Fix firmware mem leak in lme_firmware_switch()

2011-04-07 Thread Jesper Juhl
Don't leak 'fw' in drivers/media/dvb/dvb-usb/lmedm04.c::lme_firmware_switch() by failing to call release_firmware(). Signed-off-by: Jesper Juhl --- lmedm04.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) compile tested only diff --git a/drivers/media/dvb/dvb-u

[PATCH][media] DVB, DiB9000: Fix leak in dib9000_attach()

2011-04-07 Thread Jesper Juhl
If the second memory allocation in dib9000_attach() fails, we'll leak the memory allocated by the first. Signed-off-by: Jesper Juhl --- dib9000.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) compile tested only... diff --git a/drivers/media/dvb/frontends/dib9000

[PATCH][media] cx23885: Don't leak firmware in cx23885_card_setup()

2011-04-07 Thread Jesper Juhl
We leak the memory allocated to 'fw' (the firmware) when the variable goes out of scope. Fix the leak by calling release_firmware(fw) before 'fw' goes out of scope. Signed-off-by: Jesper Juhl --- cx23885-cards.c |1 + 1 file changed, 1 insertion(+) compile tested

Re: [Patch] Zarlink zl10036 DVB-S: Fix mem leak in zl10036_attach

2011-03-21 Thread Jesper Juhl
On Thu, 17 Feb 2011, Matthias Schwarzott wrote: > On Thursday 17 February 2011, Jesper Juhl wrote: > > On Thu, 17 Feb 2011, Matthias Schwarzott wrote: > > > On Sunday 06 February 2011, Jesper Juhl wrote: > > > > If the memory allocation to 'state' succeeds

Re: [Patch] Zarlink zl10036 DVB-S: Fix mem leak in zl10036_attach

2011-02-17 Thread Jesper Juhl
On Thu, 17 Feb 2011, Matthias Schwarzott wrote: > On Sunday 06 February 2011, Jesper Juhl wrote: > > If the memory allocation to 'state' succeeds but we jump to the 'error' > > label before 'state' is assigned to fe->tuner_priv, then the call to

[PATCH] TTUSB DVB: ttusb_boot_dsp() needs to release_firmware() or it leaks memory.

2011-02-06 Thread Jesper Juhl
In drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c:ttusb_boot_dsp() we need to call release_firmware(fw) before returning or we'll leak - no matter if we succeed or fail. Signed-off-by: Jesper Juhl --- dvb-ttusb-budget.c |1 + 1 file changed, 1 insertion(+) compile tested only.

[Patch] Zarlink zl10036 DVB-S: Fix mem leak in zl10036_attach

2011-02-06 Thread Jesper Juhl
e expensive than the local variable, so I just added a 'kfree(state)' call. I guess the call to 'zl10036_release' might not even be needed in this case, but I wasn't sure, so I left it in. Signed-off-by: Jesper Juhl --- zl10036.c |1 + 1 file changed, 1 insertion(+) compil

[PATCH][rfc] media, video, stv06xx, pb0100: Don't potentially deref NULL in pb0100_start().

2011-01-13 Thread Jesper Juhl
27;m not at all intimate with this code so I'd like a bit of review/comments on this before it's applied. Anyway, here's a proposed patch. Signed-off-by: Jesper Juhl --- stv06xx_pb0100.c |2 ++ 1 file changed, 2 insertions(+) compile tested only. diff --git a/dri

[PATCH] media, tlg2300: Fix memory leak in alloc_bulk_urbs_generic()

2011-01-02 Thread Jesper Juhl
or loop. This does not actually make any difference, it just seemed more correct to me to let variables exist only in the innermost scope they are used. Signed-off-by: Jesper Juhl --- pd-video.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) compile tested only. d

Re: [PATVH] media, dvb, IX2505V: Remember to free allocated memory in failure path (ix2505v_attach()).

2011-01-02 Thread Jesper Juhl
On Sun, 2 Jan 2011, Jesper Juhl wrote: > On Fri, 31 Dec 2010, Malcolm Priestley wrote: > > > On Fri, 2010-12-31 at 15:51 +0100, Jesper Juhl wrote: > > > On Fri, 31 Dec 2010, Malcolm Priestley wrote: > > > > > > > On Fri, 2010-12-31 at 00

Re: [PATVH] media, dvb, IX2505V: Remember to free allocated memory in failure path (ix2505v_attach()).

2011-01-02 Thread Jesper Juhl
On Fri, 31 Dec 2010, Malcolm Priestley wrote: > On Fri, 2010-12-31 at 15:51 +0100, Jesper Juhl wrote: > > On Fri, 31 Dec 2010, Malcolm Priestley wrote: > > > > > On Fri, 2010-12-31 at 00:11 +0100, Jesper Juhl wrote: > > > > Hi, > > > > > &g

[PATVH] media, dvb, IX2505V: Remember to free allocated memory in failure path (ix2505v_attach()).

2010-12-30 Thread Jesper Juhl
Hi, We may leak the storage allocated to 'state' in drivers/media/dvb/frontends/ix2505v.c::ix2505v_attach() on error. This patch makes sure we free the allocated memory in the failure case. Signed-off-by: Jesper Juhl --- ix2505v.c |1 + 1 file changed, 1 insertion(+) Comp

[PATCH] saa7164: Remove pointless conditional and save a few bytes in saa7164_downloadfirmware().

2010-12-18 Thread Jesper Juhl
1122144 1019927d7 drivers/media/video/saa7164/saa7164-fw.o after: textdata bss dec hex filename 7931 1122136 1017927c3 drivers/media/video/saa7164/saa7164-fw.o Signed-off-by: Jesper Juhl --- saa7164-fw.c |4 +--- 1 file changed, 1 insertion(

[PATCH 04/17][trivial] drivers/media/, cx231xx-417: Remove unnecessary casts of void ptr returning alloc function return values

2010-11-08 Thread Jesper Juhl
Hi, The [vk][cmz]alloc(_node) family of functions return void pointers which it's completely unnecessary/pointless to cast to other pointer types since that happens implicitly. This patch removes such casts from drivers/media/ Signed-off-by: Jesper Juhl --- cx231xx-417.c |4 ++-- 1