linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init()
@ 2017-01-27  8:06 Dan Carpenter
  2017-01-27  8:15 ` [patch] [media] add device IDs to ngene vdr
  2017-01-27  8:29 ` [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init() walter harms
  0 siblings, 2 replies; 10+ messages in thread
From: Dan Carpenter @ 2017-01-27  8:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, kernel-janitors

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 <dan.carpenter@oracle.com>

diff --git a/drivers/media/pci/mantis/mantis_dvb.c b/drivers/media/pci/mantis/mantis_dvb.c
index 5a71e1791cf5..0db4de3a2285 100644
--- a/drivers/media/pci/mantis/mantis_dvb.c
+++ b/drivers/media/pci/mantis/mantis_dvb.c
@@ -226,11 +226,12 @@ int mantis_dvb_init(struct mantis_pci *mantis)
 			goto err5;
 		} else {
 			if (mantis->fe == NULL) {
+				result = -ENOMEM;
 				dprintk(MANTIS_ERROR, 1, "FE <NULL>");
 				goto err5;
 			}
-
-			if (dvb_register_frontend(&mantis->dvb_adapter, mantis->fe)) {
+			result = dvb_register_frontend(&mantis->dvb_adapter, mantis->fe);
+			if (result) {
 				dprintk(MANTIS_ERROR, 1, "ERROR: Frontend registration failed");
 
 				if (mantis->fe->ops.release)

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [patch] [media] add device IDs to ngene
  2017-01-27  8:06 [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init() Dan Carpenter
@ 2017-01-27  8:15 ` vdr
  2017-01-27 13:20   ` [PATCH] [MEDIA] " vdr
  2017-01-27  8:29 ` [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init() walter harms
  1 sibling, 1 reply; 10+ messages in thread
From: vdr @ 2017-01-27  8:15 UTC (permalink / raw)
  To: linux-media; +Cc: Mauro Carvalho Chehab

Author: Helmut Auer <vdr@xxx.de>
Date:   Fri Jan 27 09:09:35 2017 +0100

    Adding 2 device ID's to ngene driver.

    Signed-off-by: Helmut Auer <vdr@xxx.de>

diff --git a/drivers/media/pci/ngene/ngene-cards.c
b/drivers/media/pci/ngene/ngene-cards.c
index 423e8c8..88815bd 100644
--- a/drivers/media/pci/ngene/ngene-cards.c
+++ b/drivers/media/pci/ngene/ngene-cards.c
@@ -753,6 +753,8 @@ static const struct ngene_info ngene_info_terratec = {
 /****************************************************************************/

 static const struct pci_device_id ngene_id_tbl[] = {
+       NGENE_ID(0x18c3, 0xab04, ngene_info_cineS2),
+       NGENE_ID(0x18c3, 0xab05, ngene_info_cineS2v5),
        NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2),
        NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2),
        NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2),



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init()
  2017-01-27  8:06 [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init() Dan Carpenter
  2017-01-27  8:15 ` [patch] [media] add device IDs to ngene vdr
@ 2017-01-27  8:29 ` walter harms
  2017-01-27  9:46   ` Dan Carpenter
  1 sibling, 1 reply; 10+ messages in thread
From: walter harms @ 2017-01-27  8:29 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors



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
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/media/pci/mantis/mantis_dvb.c b/drivers/media/pci/mantis/mantis_dvb.c
> index 5a71e1791cf5..0db4de3a2285 100644
> --- a/drivers/media/pci/mantis/mantis_dvb.c
> +++ b/drivers/media/pci/mantis/mantis_dvb.c
> @@ -226,11 +226,12 @@ int mantis_dvb_init(struct mantis_pci *mantis)
>  			goto err5;
>  		} else {
>  			if (mantis->fe == NULL) {
> +				result = -ENOMEM;
>  				dprintk(MANTIS_ERROR, 1, "FE <NULL>");
>  				goto err5;
>  			}
> -
> -			if (dvb_register_frontend(&mantis->dvb_adapter, mantis->fe)) {
> +			result = dvb_register_frontend(&mantis->dvb_adapter, mantis->fe);
> +			if (result) {
>  				dprintk(MANTIS_ERROR, 1, "ERROR: Frontend registration failed");
>  
>  				if (mantis->fe->ops.release)


hi,
just one remark:
the indent level is deep.
using  if ( !mantis->hwconfig) return 0;
and killing the "else" would help with readability.

just my 2 cents
re,
 wh


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init()
  2017-01-27  8:29 ` [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init() walter harms
@ 2017-01-27  9:46   ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2017-01-27  9:46 UTC (permalink / raw)
  To: walter harms; +Cc: Mauro Carvalho Chehab, linux-media, kernel-janitors

You're, of course, correct that this code could be cleaned up...

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] [MEDIA] add device IDs to ngene
  2017-01-27  8:15 ` [patch] [media] add device IDs to ngene vdr
@ 2017-01-27 13:20   ` vdr
  2017-02-07  8:42     ` [PATCH] [MEDIA] add device ID to ati remote vdr
  2017-02-14  7:20     ` [PATCH] [MEDIA] add device IDs to ngene driver Helmut Auer
  0 siblings, 2 replies; 10+ messages in thread
From: vdr @ 2017-01-27 13:20 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List


Author: Helmut Auer <vdr@xxx.de>
Date:   Fri Jan 27 09:09:35 2017 +0100

    Adding 2 device ID's to ngene driver.

    Signed-off-by: Helmut Auer <vdr@xxx.de>

diff --git a/drivers/media/pci/ngene/ngene-cards.c
b/drivers/media/pci/ngene/ngene-cards.c
index 423e8c8..88815bd 100644
--- a/drivers/media/pci/ngene/ngene-cards.c
+++ b/drivers/media/pci/ngene/ngene-cards.c
@@ -753,6 +753,8 @@ static const struct ngene_info ngene_info_terratec = {
 /****************************************************************************/

 static const struct pci_device_id ngene_id_tbl[] = {
+       NGENE_ID(0x18c3, 0xab04, ngene_info_cineS2),
+       NGENE_ID(0x18c3, 0xab05, ngene_info_cineS2v5),
        NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2),
        NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2),
        NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2),



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] [MEDIA] add device ID to ati remote
  2017-01-27 13:20   ` [PATCH] [MEDIA] " vdr
@ 2017-02-07  8:42     ` vdr
  2017-02-13 13:42       ` Sean Young
  2017-02-14  7:20     ` [PATCH] [MEDIA] add device IDs to ngene driver Helmut Auer
  1 sibling, 1 reply; 10+ messages in thread
From: vdr @ 2017-02-07  8:42 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List


Author: Helmut Auer <vdr@xxx.de>
Date:   Fri Jan 27 19:09:35 2017 +0100

    Adding 1 device ID to ati_remote driver.

    Signed-off-by: Helmut Auer <vdr@xxx.de>

diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
index 0884b7d..83022b1 100644
--- a/drivers/media/rc/ati_remote.c
+++ b/drivers/media/rc/ati_remote.c
@@ -108,6 +108,7 @@
 #define NVIDIA_REMOTE_PRODUCT_ID       0x0005
 #define MEDION_REMOTE_PRODUCT_ID       0x0006
 #define FIREFLY_REMOTE_PRODUCT_ID      0x0008
+#define REYCOM_REMOTE_PRODUCT_ID       0x000c

 #define DRIVER_VERSION         "2.2.1"
 #define DRIVER_AUTHOR           "Torrey Hoffman <thoffman@arnor.net>"
@@ -227,6 +228,10 @@ static struct usb_device_id ati_remote_table[] = {
                USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID),
                .driver_info = (unsigned long)&type_firefly
        },
+       {
+               USB_DEVICE(ATI_REMOTE_VENDOR_ID, REYCOM_REMOTE_PRODUCT_ID),
+               .driver_info = (unsigned long)&type_firefly
+       },
        {}      /* Terminating entry */
 };



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] [MEDIA] add device ID to ati remote
  2017-02-07  8:42     ` [PATCH] [MEDIA] add device ID to ati remote vdr
@ 2017-02-13 13:42       ` Sean Young
  2017-02-13 22:57         ` Helmut Auer
  2017-02-14  7:11         ` Helmut Auer
  0 siblings, 2 replies; 10+ messages in thread
From: Sean Young @ 2017-02-13 13:42 UTC (permalink / raw)
  To: vdr; +Cc: Mauro Carvalho Chehab, Linux Media Mailing List

On Tue, Feb 07, 2017 at 09:42:47AM +0100, vdr@helmutauer.de wrote:
> 
> Author: Helmut Auer <vdr@xxx.de>
> Date:   Fri Jan 27 19:09:35 2017 +0100
> 
>     Adding 1 device ID to ati_remote driver.

If possible, a more descriptive message would be preferred, e.g. what
device do you have, what branding, what product did it come with.

> 
>     Signed-off-by: Helmut Auer <vdr@xxx.de>

Unless I'm mistaken, contributions can't be anonymous or use a fake email
address.

> 
> diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
> index 0884b7d..83022b1 100644
> --- a/drivers/media/rc/ati_remote.c
> +++ b/drivers/media/rc/ati_remote.c
> @@ -108,6 +108,7 @@
>  #define NVIDIA_REMOTE_PRODUCT_ID       0x0005
>  #define MEDION_REMOTE_PRODUCT_ID       0x0006
>  #define FIREFLY_REMOTE_PRODUCT_ID      0x0008
> +#define REYCOM_REMOTE_PRODUCT_ID       0x000c
> 
>  #define DRIVER_VERSION         "2.2.1"
>  #define DRIVER_AUTHOR           "Torrey Hoffman <thoffman@arnor.net>"
> @@ -227,6 +228,10 @@ static struct usb_device_id ati_remote_table[] = {
>                 USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID),
>                 .driver_info = (unsigned long)&type_firefly
>         },
> +       {
> +               USB_DEVICE(ATI_REMOTE_VENDOR_ID, REYCOM_REMOTE_PRODUCT_ID),
> +               .driver_info = (unsigned long)&type_firefly
> +       },
>         {}      /* Terminating entry */
>  };

Your email client replaced all tabs with spaces so the patch no longer
applies.

Thanks,
Sean

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] [MEDIA] add device ID to ati remote
  2017-02-13 13:42       ` Sean Young
@ 2017-02-13 22:57         ` Helmut Auer
  2017-02-14  7:11         ` Helmut Auer
  1 sibling, 0 replies; 10+ messages in thread
From: Helmut Auer @ 2017-02-13 22:57 UTC (permalink / raw)
  To: Sean Young; +Cc: Mauro Carvalho Chehab, Linux Media Mailing List

Hello

Thanks for the info, but sorry I'm not willinmg to do anything more to get the patch into the kernel.
I have an own distribution and I am applying those patches and thats easier than committing it to the kernel ;)
Maybe anyone who needs this finds this patch.

Kind regards
Helmut

Am 13.02.2017 um 14:42 schrieb Sean Young:
> On Tue, Feb 07, 2017 at 09:42:47AM +0100, vdr@helmutauer.de wrote:
>>
>> Author: Helmut Auer <vdr@xxx.de>
>> Date:   Fri Jan 27 19:09:35 2017 +0100
>>
>>      Adding 1 device ID to ati_remote driver.
>
> If possible, a more descriptive message would be preferred, e.g. what
> device do you have, what branding, what product did it come with.
>
>>
>>      Signed-off-by: Helmut Auer <vdr@xxx.de>
>
> Unless I'm mistaken, contributions can't be anonymous or use a fake email
> address.
>
>>
>> diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c
>> index 0884b7d..83022b1 100644
>> --- a/drivers/media/rc/ati_remote.c
>> +++ b/drivers/media/rc/ati_remote.c
>> @@ -108,6 +108,7 @@
>>   #define NVIDIA_REMOTE_PRODUCT_ID       0x0005
>>   #define MEDION_REMOTE_PRODUCT_ID       0x0006
>>   #define FIREFLY_REMOTE_PRODUCT_ID      0x0008
>> +#define REYCOM_REMOTE_PRODUCT_ID       0x000c
>>
>>   #define DRIVER_VERSION         "2.2.1"
>>   #define DRIVER_AUTHOR           "Torrey Hoffman <thoffman@arnor.net>"
>> @@ -227,6 +228,10 @@ static struct usb_device_id ati_remote_table[] = {
>>                  USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID),
>>                  .driver_info = (unsigned long)&type_firefly
>>          },
>> +       {
>> +               USB_DEVICE(ATI_REMOTE_VENDOR_ID, REYCOM_REMOTE_PRODUCT_ID),
>> +               .driver_info = (unsigned long)&type_firefly
>> +       },
>>          {}      /* Terminating entry */
>>   };
>
> Your email client replaced all tabs with spaces so the patch no longer
> applies.
>
> Thanks,
> Sean
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] [MEDIA] add device ID to ati remote
  2017-02-13 13:42       ` Sean Young
  2017-02-13 22:57         ` Helmut Auer
@ 2017-02-14  7:11         ` Helmut Auer
  1 sibling, 0 replies; 10+ messages in thread
From: Helmut Auer @ 2017-02-14  7:11 UTC (permalink / raw)
  To: Sean Young; +Cc: Mauro Carvalho Chehab, Linux Media Mailing List

[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]

P.S. Here is the patch again with a correction.

> On Tue, Feb 07, 2017 at 09:42:47AM +0100, vdr@helmutauer.de wrote:
>>
>> Author: Helmut Auer <vdr@xxx.de>
>> Date:   Fri Jan 27 19:09:35 2017 +0100
>>
>>     Adding 1 device ID to ati_remote driver.
>
> If possible, a more descriptive message would be preferred, e.g. what
> device do you have, what branding, what product did it come with.
>
>>
>>     Signed-off-by: Helmut Auer <vdr@xxx.de>
>
> Unless I'm mistaken, contributions can't be anonymous or use a fake email
> address.
>
>>
>> diff --git a/drivers/media/rc/ati_remote.c
>> b/drivers/media/rc/ati_remote.c
>> index 0884b7d..83022b1 100644
>> --- a/drivers/media/rc/ati_remote.c
>> +++ b/drivers/media/rc/ati_remote.c
>> @@ -108,6 +108,7 @@
>>  #define NVIDIA_REMOTE_PRODUCT_ID       0x0005
>>  #define MEDION_REMOTE_PRODUCT_ID       0x0006
>>  #define FIREFLY_REMOTE_PRODUCT_ID      0x0008
>> +#define REYCOM_REMOTE_PRODUCT_ID       0x000c
>>
>>  #define DRIVER_VERSION         "2.2.1"
>>  #define DRIVER_AUTHOR           "Torrey Hoffman <thoffman@arnor.net>"
>> @@ -227,6 +228,10 @@ static struct usb_device_id ati_remote_table[] = {
>>                 USB_DEVICE(ATI_REMOTE_VENDOR_ID,
>> FIREFLY_REMOTE_PRODUCT_ID),
>>                 .driver_info = (unsigned long)&type_firefly
>>         },
>> +       {
>> +               USB_DEVICE(ATI_REMOTE_VENDOR_ID,
>> REYCOM_REMOTE_PRODUCT_ID),
>> +               .driver_info = (unsigned long)&type_firefly
>> +       },
>>         {}      /* Terminating entry */
>>  };
>
> Your email client replaced all tabs with spaces so the patch no longer
> applies.
>
> Thanks,
> Sean
>

[-- Attachment #2: 015_atireycom.patch --]
[-- Type: application/octet-stream, Size: 721 bytes --]

--- drivers/media/rc/ati_remote.c	2016-12-11 20:17:54.000000000 +0100
+++ drivers/media/rc/ati_remote.c	2017-02-07 08:39:25.860644177 +0100
@@ -108,6 +108,7 @@
 #define NVIDIA_REMOTE_PRODUCT_ID	0x0005
 #define MEDION_REMOTE_PRODUCT_ID	0x0006
 #define FIREFLY_REMOTE_PRODUCT_ID	0x0008
+#define REYCOM_REMOTE_PRODUCT_ID	0x000c
 
 #define DRIVER_VERSION		"2.2.1"
 #define DRIVER_AUTHOR           "Torrey Hoffman <thoffman@arnor.net>"
@@ -227,6 +228,10 @@
 		USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID),
 		.driver_info = (unsigned long)&type_firefly
 	},
+	{
+		USB_DEVICE(ATI_REMOTE_VENDOR_ID, REYCOM_REMOTE_PRODUCT_ID),
+		.driver_info = (unsigned long)&type_medion
+	},
 	{}	/* Terminating entry */
 };
 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] [MEDIA] add device IDs to ngene driver
  2017-01-27 13:20   ` [PATCH] [MEDIA] " vdr
  2017-02-07  8:42     ` [PATCH] [MEDIA] add device ID to ati remote vdr
@ 2017-02-14  7:20     ` Helmut Auer
  1 sibling, 0 replies; 10+ messages in thread
From: Helmut Auer @ 2017-02-14  7:20 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

Author: Helmut Auer <vdr@helmutauer.de>
Date:   Fri Jan 27 09:09:35 2017 +0100

     Adding 2 device ID's to ngene driver.

     Signed-off-by: Helmut Auer <vdr@helmutauer.de>

--- drivers/media/pci/ngene/ngene-cards.c        2016-12-11
20:17:54.000000000 +0100
+++ drivers/media/pci/ngene/ngene-cards.c        2017-01-20
08:46:48.263666132 +0100
@@ -753,6 +753,8 @@
 /****************************************************************************/

 static const struct pci_device_id ngene_id_tbl[] = {
+	NGENE_ID(0x18c3, 0xab04, ngene_info_cineS2),
+	NGENE_ID(0x18c3, 0xab05, ngene_info_cineS2v5),
 	NGENE_ID(0x18c3, 0xabc3, ngene_info_cineS2),
 	NGENE_ID(0x18c3, 0xabc4, ngene_info_cineS2),
 	NGENE_ID(0x18c3, 0xdb01, ngene_info_satixS2),

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-02-14  7:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-27  8:06 [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init() Dan Carpenter
2017-01-27  8:15 ` [patch] [media] add device IDs to ngene vdr
2017-01-27 13:20   ` [PATCH] [MEDIA] " vdr
2017-02-07  8:42     ` [PATCH] [MEDIA] add device ID to ati remote vdr
2017-02-13 13:42       ` Sean Young
2017-02-13 22:57         ` Helmut Auer
2017-02-14  7:11         ` Helmut Auer
2017-02-14  7:20     ` [PATCH] [MEDIA] add device IDs to ngene driver Helmut Auer
2017-01-27  8:29 ` [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init() walter harms
2017-01-27  9:46   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).