netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] add return value check of request_irq()
@ 2007-06-05 13:55 Yoichi Yuasa
  2007-06-13 19:55 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Yoichi Yuasa @ 2007-06-05 13:55 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: yoichi_yuasa, netdev

Hi,

This patch has added return value check of request_irq() to pcmcia net drivers.

Yoichi

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>

diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/net/pcmcia/axnet_cs.c generic/drivers/net/pcmcia/axnet_cs.c
--- generic-orig/drivers/net/pcmcia/axnet_cs.c	2007-06-05 11:12:22.039270000 +0900
+++ generic/drivers/net/pcmcia/axnet_cs.c	2007-06-05 22:41:57.017445250 +0900
@@ -521,6 +521,7 @@ static void mdio_write(kio_addr_t addr, 
 
 static int axnet_open(struct net_device *dev)
 {
+    int ret;
     axnet_dev_t *info = PRIV(dev);
     struct pcmcia_device *link = info->p_dev;
     
@@ -529,9 +530,11 @@ static int axnet_open(struct net_device 
     if (!pcmcia_dev_present(link))
 	return -ENODEV;
 
-    link->open++;
+    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev);
+    if (ret)
+	    return ret;
 
-    request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, "axnet_cs", dev);
+    link->open++;
 
     info->link_status = 0x00;
     init_timer(&info->watchdog);
diff -pruN -X generic/Documentation/dontdiff generic-orig/drivers/net/pcmcia/pcnet_cs.c generic/drivers/net/pcmcia/pcnet_cs.c
--- generic-orig/drivers/net/pcmcia/pcnet_cs.c	2007-06-05 11:12:22.043270250 +0900
+++ generic/drivers/net/pcmcia/pcnet_cs.c	2007-06-05 22:41:45.656735250 +0900
@@ -960,6 +960,7 @@ static void mii_phy_probe(struct net_dev
 
 static int pcnet_open(struct net_device *dev)
 {
+    int ret;
     pcnet_dev_t *info = PRIV(dev);
     struct pcmcia_device *link = info->p_dev;
 
@@ -968,10 +969,12 @@ static int pcnet_open(struct net_device 
     if (!pcmcia_dev_present(link))
 	return -ENODEV;
 
-    link->open++;
-
     set_misc_reg(dev);
-    request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev);
+    ret = request_irq(dev->irq, ei_irq_wrapper, IRQF_SHARED, dev_info, dev);
+    if (ret)
+	    return ret;
+
+    link->open++;
 
     info->phy_id = info->eth_phy;
     info->link_status = 0x00;

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

end of thread, other threads:[~2007-06-13 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-05 13:55 [PATCH] add return value check of request_irq() Yoichi Yuasa
2007-06-13 19:55 ` Jeff Garzik

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).