public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking
@ 2017-11-16  4:27 Arvind Yadav
  2017-11-16  4:27 ` [PATCH 01/12] isdn: hisax: Fix pnp_irq's error checking for setup_asuscom Arvind Yadav
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Arvind Yadav (12):
  [PATCH 01/12] isdn: hisax: Fix pnp_irq's error checking for setup_asuscom
  [PATCH 02/12] isdn: hisax: Fix pnp_irq's error checking for avm_pnp_setup
  [PATCH 03/12] isdn: hisax: Fix pnp_irq's error checking for setup_diva_isapnp
  [PATCH 04/12] isdn: hisax: Fix pnp_irq's error checking for setup_elsa_isapnp
  [PATCH 05/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcsx
  [PATCH 06/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcs
  [PATCH 07/12] isdn: hisax: Handle return value of pnp_irq and pnp_port_start
  [PATCH 08/12] isdn: hisax: Fix pnp_irq's error checking for setup_isurf
  [PATCH 09/12] isdn: hisax: Fix pnp_irq's error checking for setup_ix1micro
  [PATCH 10/12] isdn: hisax: Fix pnp_irq's error checking for setup_niccy
  [PATCH 11/12] isdn: hisax: Fix pnp_irq's error checking for setup_sedlbauer_isapnp
  [PATCH 12/12] isdn: hisax: Fix pnp_irq's error checking for setup_teles3

 drivers/isdn/hisax/asuscom.c        | 2 +-
 drivers/isdn/hisax/avm_pci.c        | 2 +-
 drivers/isdn/hisax/diva.c           | 2 +-
 drivers/isdn/hisax/elsa.c           | 2 +-
 drivers/isdn/hisax/hfc_sx.c         | 2 +-
 drivers/isdn/hisax/hfcscard.c       | 2 +-
 drivers/isdn/hisax/hisax_fcpcipnp.c | 2 ++
 drivers/isdn/hisax/isurf.c          | 2 +-
 drivers/isdn/hisax/ix1_micro.c      | 2 +-
 drivers/isdn/hisax/niccy.c          | 2 +-
 drivers/isdn/hisax/sedlbauer.c      | 2 +-
 drivers/isdn/hisax/teles3.c         | 2 +-
 12 files changed, 13 insertions(+), 11 deletions(-)

-- 
1.9.1

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

* [PATCH 01/12] isdn: hisax: Fix pnp_irq's error checking for setup_asuscom
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 02/12] isdn: hisax: Fix pnp_irq's error checking for avm_pnp_setup Arvind Yadav
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/asuscom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/asuscom.c b/drivers/isdn/hisax/asuscom.c
index 62f9c43..74c8714 100644
--- a/drivers/isdn/hisax/asuscom.c
+++ b/drivers/isdn/hisax/asuscom.c
@@ -348,7 +348,7 @@ int setup_asuscom(struct IsdnCard *card)
 					}
 					card->para[1] = pnp_port_start(pnp_d, 0);
 					card->para[0] = pnp_irq(pnp_d, 0);
-					if (!card->para[0] || !card->para[1]) {
+					if (card->para[0] == -1 || !card->para[1]) {
 						printk(KERN_ERR "AsusPnP:some resources are missing %ld/%lx\n",
 						       card->para[0], card->para[1]);
 						pnp_disable_dev(pnp_d);
-- 
1.9.1

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

* [PATCH 02/12] isdn: hisax: Fix pnp_irq's error checking for avm_pnp_setup
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
  2017-11-16  4:27 ` [PATCH 01/12] isdn: hisax: Fix pnp_irq's error checking for setup_asuscom Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 03/12] isdn: hisax: Fix pnp_irq's error checking for setup_diva_isapnp Arvind Yadav
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/avm_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c
index daf3742..a18b605 100644
--- a/drivers/isdn/hisax/avm_pci.c
+++ b/drivers/isdn/hisax/avm_pci.c
@@ -805,7 +805,7 @@ static int avm_pnp_setup(struct IsdnCardState *cs)
 			cs->hw.avm.cfg_reg =
 				pnp_port_start(pnp_avm_d, 0);
 			cs->irq = pnp_irq(pnp_avm_d, 0);
-			if (!cs->irq) {
+			if (cs->irq == -1) {
 				printk(KERN_ERR "FritzPnP:No IRQ\n");
 				return (0);
 			}
-- 
1.9.1

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

* [PATCH 03/12] isdn: hisax: Fix pnp_irq's error checking for setup_diva_isapnp
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
  2017-11-16  4:27 ` [PATCH 01/12] isdn: hisax: Fix pnp_irq's error checking for setup_asuscom Arvind Yadav
  2017-11-16  4:27 ` [PATCH 02/12] isdn: hisax: Fix pnp_irq's error checking for avm_pnp_setup Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 04/12] isdn: hisax: Fix pnp_irq's error checking for setup_elsa_isapnp Arvind Yadav
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/diva.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c
index 3fc94e7..bed749c 100644
--- a/drivers/isdn/hisax/diva.c
+++ b/drivers/isdn/hisax/diva.c
@@ -1094,7 +1094,7 @@ static int setup_diva_isapnp(struct IsdnCard *card)
 				}
 				card->para[1] = pnp_port_start(pnp_d, 0);
 				card->para[0] = pnp_irq(pnp_d, 0);
-				if (!card->para[0] || !card->para[1]) {
+				if (card->para[0] == -1 || !card->para[1]) {
 					printk(KERN_ERR "Diva PnP:some resources are missing %ld/%lx\n",
 					       card->para[0], card->para[1]);
 					pnp_disable_dev(pnp_d);
-- 
1.9.1

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

* [PATCH 04/12] isdn: hisax: Fix pnp_irq's error checking for setup_elsa_isapnp
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (2 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 03/12] isdn: hisax: Fix pnp_irq's error checking for setup_diva_isapnp Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 05/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcsx Arvind Yadav
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/elsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c
index 03bc5d5..f8dcac8 100644
--- a/drivers/isdn/hisax/elsa.c
+++ b/drivers/isdn/hisax/elsa.c
@@ -945,7 +945,7 @@ static int setup_elsa_isapnp(struct IsdnCard *card)
 					card->para[1] = pnp_port_start(pnp_d, 0);
 					card->para[0] = pnp_irq(pnp_d, 0);
 
-					if (!card->para[0] || !card->para[1]) {
+					if (card->para[0] == -1 || !card->para[1]) {
 						printk(KERN_ERR "Elsa PnP:some resources are missing %ld/%lx\n",
 						       card->para[0], card->para[1]);
 						pnp_disable_dev(pnp_d);
-- 
1.9.1

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

* [PATCH 05/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcsx
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (3 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 04/12] isdn: hisax: Fix pnp_irq's error checking for setup_elsa_isapnp Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 06/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcs Arvind Yadav
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/hfc_sx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/hfc_sx.c b/drivers/isdn/hisax/hfc_sx.c
index 3aef8e1..99f5a93 100644
--- a/drivers/isdn/hisax/hfc_sx.c
+++ b/drivers/isdn/hisax/hfc_sx.c
@@ -1422,7 +1422,7 @@ int setup_hfcsx(struct IsdnCard *card)
 					}
 					card->para[1] = pnp_port_start(pnp_d, 0);
 					card->para[0] = pnp_irq(pnp_d, 0);
-					if (!card->para[0] || !card->para[1]) {
+					if (card->para[0] == -1 || !card->para[1]) {
 						printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
 						       card->para[0], card->para[1]);
 						pnp_disable_dev(pnp_d);
-- 
1.9.1

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

* [PATCH 06/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcs
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (4 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 05/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcsx Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 07/12] isdn: hisax: Handle return value of pnp_irq and pnp_port_start Arvind Yadav
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/hfcscard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c
index 4672870..3cbde72 100644
--- a/drivers/isdn/hisax/hfcscard.c
+++ b/drivers/isdn/hisax/hfcscard.c
@@ -195,7 +195,7 @@ int setup_hfcs(struct IsdnCard *card)
 					}
 					card->para[1] = pnp_port_start(pnp_d, 0);
 					card->para[0] = pnp_irq(pnp_d, 0);
-					if (!card->para[0] || !card->para[1]) {
+					if (card->para[0] == -1 || !card->para[1]) {
 						printk(KERN_ERR "HFC PnP:some resources are missing %ld/%lx\n",
 						       card->para[0], card->para[1]);
 						pnp_disable_dev(pnp_d);
-- 
1.9.1

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

* [PATCH 07/12] isdn: hisax: Handle return value of pnp_irq and pnp_port_start
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (5 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 06/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcs Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 08/12] isdn: hisax: Fix pnp_irq's error checking for setup_isurf Arvind Yadav
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

pnp_irq() and pnp_port_start() can fail here and we must check
its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/hisax_fcpcipnp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c b/drivers/isdn/hisax/hisax_fcpcipnp.c
index e4f7573..7a7137d 100644
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -940,6 +940,8 @@ static int fcpnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
 	}
 	adapter->io = pnp_port_start(pdev, 0);
 	adapter->irq = pnp_irq(pdev, 0);
+	if (!adapter->io || adapter->irq == -1)
+		goto err_free;
 
 	printk(KERN_INFO "hisax_fcpcipnp: found adapter %s at IO %#x irq %d\n",
 	       (char *) dev_id->driver_data, adapter->io, adapter->irq);
-- 
1.9.1

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

* [PATCH 08/12] isdn: hisax: Fix pnp_irq's error checking for setup_isurf
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (6 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 07/12] isdn: hisax: Handle return value of pnp_irq and pnp_port_start Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 09/12] isdn: hisax: Fix pnp_irq's error checking for setup_ix1micro Arvind Yadav
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/isurf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
index 1399ddd..53e299b 100644
--- a/drivers/isdn/hisax/isurf.c
+++ b/drivers/isdn/hisax/isurf.c
@@ -238,7 +238,7 @@ int setup_isurf(struct IsdnCard *card)
 				cs->hw.isurf.reset = pnp_port_start(pnp_d, 0);
 				cs->hw.isurf.phymem = pnp_mem_start(pnp_d, 1);
 				cs->irq = pnp_irq(pnp_d, 0);
-				if (!cs->irq || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
+				if (cs->irq == -1 || !cs->hw.isurf.reset || !cs->hw.isurf.phymem) {
 					printk(KERN_ERR "ISurfPnP:some resources are missing %d/%x/%lx\n",
 					       cs->irq, cs->hw.isurf.reset, cs->hw.isurf.phymem);
 					pnp_disable_dev(pnp_d);
-- 
1.9.1

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

* [PATCH 09/12] isdn: hisax: Fix pnp_irq's error checking for setup_ix1micro
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (7 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 08/12] isdn: hisax: Fix pnp_irq's error checking for setup_isurf Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 10/12] isdn: hisax: Fix pnp_irq's error checking for setup_niccy Arvind Yadav
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/ix1_micro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/ix1_micro.c b/drivers/isdn/hisax/ix1_micro.c
index 7ae39f5..bfb79f3 100644
--- a/drivers/isdn/hisax/ix1_micro.c
+++ b/drivers/isdn/hisax/ix1_micro.c
@@ -256,7 +256,7 @@ int setup_ix1micro(struct IsdnCard *card)
 					}
 					card->para[1] = pnp_port_start(pnp_d, 0);
 					card->para[0] = pnp_irq(pnp_d, 0);
-					if (!card->para[0] || !card->para[1]) {
+					if (card->para[0] == -1 || !card->para[1]) {
 						printk(KERN_ERR "ITK PnP:some resources are missing %ld/%lx\n",
 						       card->para[0], card->para[1]);
 						pnp_disable_dev(pnp_d);
-- 
1.9.1

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

* [PATCH 10/12] isdn: hisax: Fix pnp_irq's error checking for setup_niccy
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (8 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 09/12] isdn: hisax: Fix pnp_irq's error checking for setup_ix1micro Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 11/12] isdn: hisax: Fix pnp_irq's error checking for setup_sedlbauer_isapnp Arvind Yadav
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/niccy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/niccy.c b/drivers/isdn/hisax/niccy.c
index e4c33cf..dfbcd2e 100644
--- a/drivers/isdn/hisax/niccy.c
+++ b/drivers/isdn/hisax/niccy.c
@@ -261,7 +261,7 @@ int setup_niccy(struct IsdnCard *card)
 			card->para[1] = pnp_port_start(pnp_d, 0);
 			card->para[2] = pnp_port_start(pnp_d, 1);
 			card->para[0] = pnp_irq(pnp_d, 0);
-			if (!card->para[0] || !card->para[1] ||
+			if (card->para[0] == -1 || !card->para[1] ||
 			    !card->para[2]) {
 				printk(KERN_ERR "NiccyPnP:some resources are "
 				       "missing %ld/%lx/%lx\n",
-- 
1.9.1

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

* [PATCH 11/12] isdn: hisax: Fix pnp_irq's error checking for setup_sedlbauer_isapnp
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (9 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 10/12] isdn: hisax: Fix pnp_irq's error checking for setup_niccy Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16  4:27 ` [PATCH 12/12] isdn: hisax: Fix pnp_irq's error checking for setup_teles3 Arvind Yadav
  2017-11-16 13:32 ` [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking David Miller
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/sedlbauer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c
index f16a47b..c0b97b8 100644
--- a/drivers/isdn/hisax/sedlbauer.c
+++ b/drivers/isdn/hisax/sedlbauer.c
@@ -558,7 +558,7 @@ static int setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
 				card->para[1] = pnp_port_start(pnp_d, 0);
 				card->para[0] = pnp_irq(pnp_d, 0);
 
-				if (!card->para[0] || !card->para[1]) {
+				if (card->para[0] == -1 || !card->para[1]) {
 					printk(KERN_ERR "Sedlbauer PnP:some resources are missing %ld/%lx\n",
 					       card->para[0], card->para[1]);
 					pnp_disable_dev(pnp_d);
-- 
1.9.1

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

* [PATCH 12/12] isdn: hisax: Fix pnp_irq's error checking for setup_teles3
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (10 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 11/12] isdn: hisax: Fix pnp_irq's error checking for setup_sedlbauer_isapnp Arvind Yadav
@ 2017-11-16  4:27 ` Arvind Yadav
  2017-11-16 13:32 ` [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking David Miller
  12 siblings, 0 replies; 14+ messages in thread
From: Arvind Yadav @ 2017-11-16  4:27 UTC (permalink / raw)
  To: isdn, davem, stephen, johannes.berg; +Cc: linux-kernel, netdev

The pnp_irq() function returns -1 if an error occurs.
pnp_irq() error checking for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail•com>
---
 drivers/isdn/hisax/teles3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/teles3.c b/drivers/isdn/hisax/teles3.c
index 38fb2c1..1eef693 100644
--- a/drivers/isdn/hisax/teles3.c
+++ b/drivers/isdn/hisax/teles3.c
@@ -306,7 +306,7 @@ int setup_teles3(struct IsdnCard *card)
 					card->para[2] = pnp_port_start(pnp_d, 1);
 					card->para[1] = pnp_port_start(pnp_d, 0);
 					card->para[0] = pnp_irq(pnp_d, 0);
-					if (!card->para[0] || !card->para[1] || !card->para[2]) {
+					if (card->para[0] == -1 || !card->para[1] || !card->para[2]) {
 						printk(KERN_ERR "Teles PnP:some resources are missing %ld/%lx/%lx\n",
 						       card->para[0], card->para[1], card->para[2]);
 						pnp_disable_dev(pnp_d);
-- 
1.9.1

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

* Re: [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking
  2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
                   ` (11 preceding siblings ...)
  2017-11-16  4:27 ` [PATCH 12/12] isdn: hisax: Fix pnp_irq's error checking for setup_teles3 Arvind Yadav
@ 2017-11-16 13:32 ` David Miller
  12 siblings, 0 replies; 14+ messages in thread
From: David Miller @ 2017-11-16 13:32 UTC (permalink / raw)
  To: arvind.yadav.cs; +Cc: isdn, stephen, johannes.berg, linux-kernel, netdev

From: Arvind Yadav <arvind.yadav.cs@gmail•com>
Date: Thu, 16 Nov 2017 09:57:17 +0530

> The pnp_irq() function returns -1 if an error occurs.
> pnp_irq() error checking for zero is not correct.

I can't say I like all of the mixing of "-1", and unsigned
integer values (pnp_irq() returns resource_size_t, the
IsdnCard->para[] arran entries are "unsigned long") but
what can I do.

Series applied, thanks.

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

end of thread, other threads:[~2017-11-16 13:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-16  4:27 [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking Arvind Yadav
2017-11-16  4:27 ` [PATCH 01/12] isdn: hisax: Fix pnp_irq's error checking for setup_asuscom Arvind Yadav
2017-11-16  4:27 ` [PATCH 02/12] isdn: hisax: Fix pnp_irq's error checking for avm_pnp_setup Arvind Yadav
2017-11-16  4:27 ` [PATCH 03/12] isdn: hisax: Fix pnp_irq's error checking for setup_diva_isapnp Arvind Yadav
2017-11-16  4:27 ` [PATCH 04/12] isdn: hisax: Fix pnp_irq's error checking for setup_elsa_isapnp Arvind Yadav
2017-11-16  4:27 ` [PATCH 05/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcsx Arvind Yadav
2017-11-16  4:27 ` [PATCH 06/12] isdn: hisax: Fix pnp_irq's error checking for setup_hfcs Arvind Yadav
2017-11-16  4:27 ` [PATCH 07/12] isdn: hisax: Handle return value of pnp_irq and pnp_port_start Arvind Yadav
2017-11-16  4:27 ` [PATCH 08/12] isdn: hisax: Fix pnp_irq's error checking for setup_isurf Arvind Yadav
2017-11-16  4:27 ` [PATCH 09/12] isdn: hisax: Fix pnp_irq's error checking for setup_ix1micro Arvind Yadav
2017-11-16  4:27 ` [PATCH 10/12] isdn: hisax: Fix pnp_irq's error checking for setup_niccy Arvind Yadav
2017-11-16  4:27 ` [PATCH 11/12] isdn: hisax: Fix pnp_irq's error checking for setup_sedlbauer_isapnp Arvind Yadav
2017-11-16  4:27 ` [PATCH 12/12] isdn: hisax: Fix pnp_irq's error checking for setup_teles3 Arvind Yadav
2017-11-16 13:32 ` [PATCH 00/12] isdn: hisax: Fix pnp_irq's error checking David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox