public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] drivers/net/pcmcia/nmclan_cs.c: fix a check after use
@ 2005-03-27 20:44 Adrian Bunk
  0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2005-03-27 20:44 UTC (permalink / raw)
  To: linux-kernel

This patch fixes a check after use found by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.12-rc1-mm1-full/drivers/net/pcmcia/nmclan_cs.c.old	2005-03-23 05:04:00.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/drivers/net/pcmcia/nmclan_cs.c	2005-03-23 05:04:30.000000000 +0100
@@ -1090,20 +1090,22 @@
 ---------------------------------------------------------------------------- */
 static irqreturn_t mace_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
   struct net_device *dev = (struct net_device *) dev_id;
   mace_private *lp = netdev_priv(dev);
-  kio_addr_t ioaddr = dev->base_addr;
+  kio_addr_t ioaddr;
   int status;
   int IntrCnt = MACE_MAX_IR_ITERATIONS;
 
   if (dev == NULL) {
     DEBUG(2, "mace_interrupt(): irq 0x%X for unknown device.\n",
 	  irq);
     return IRQ_NONE;
   }
 
+  ioaddr = dev->base_addr;
+
   if (lp->tx_irq_disabled) {
     printk(
       (lp->tx_irq_disabled?
        KERN_NOTICE "%s: Interrupt with tx_irq_disabled "
        "[isr=%02X, imr=%02X]\n": 


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

* [2.6 patch] drivers/net/pcmcia/nmclan_cs.c: fix a check after use
@ 2005-04-13  2:17 Adrian Bunk
  2005-04-13  2:53 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2005-04-13  2:17 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

This patch fixes a check after use found by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

This patch was already sent on:
- 27 Mar 2005

--- linux-2.6.12-rc1-mm1-full/drivers/net/pcmcia/nmclan_cs.c.old	2005-03-23 05:04:00.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/drivers/net/pcmcia/nmclan_cs.c	2005-03-23 05:04:30.000000000 +0100
@@ -1090,20 +1090,22 @@
 ---------------------------------------------------------------------------- */
 static irqreturn_t mace_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
   struct net_device *dev = (struct net_device *) dev_id;
   mace_private *lp = netdev_priv(dev);
-  kio_addr_t ioaddr = dev->base_addr;
+  kio_addr_t ioaddr;
   int status;
   int IntrCnt = MACE_MAX_IR_ITERATIONS;
 
   if (dev == NULL) {
     DEBUG(2, "mace_interrupt(): irq 0x%X for unknown device.\n",
 	  irq);
     return IRQ_NONE;
   }
 
+  ioaddr = dev->base_addr;
+
   if (lp->tx_irq_disabled) {
     printk(
       (lp->tx_irq_disabled?
        KERN_NOTICE "%s: Interrupt with tx_irq_disabled "
        "[isr=%02X, imr=%02X]\n": 


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

* Re: [2.6 patch] drivers/net/pcmcia/nmclan_cs.c: fix a check after use
  2005-04-13  2:17 [2.6 patch] drivers/net/pcmcia/nmclan_cs.c: fix a check after use Adrian Bunk
@ 2005-04-13  2:53 ` Al Viro
  0 siblings, 0 replies; 3+ messages in thread
From: Al Viro @ 2005-04-13  2:53 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Andrew Morton, linux-kernel

On Wed, Apr 13, 2005 at 04:17:34AM +0200, Adrian Bunk wrote:
> This patch fixes a check after use found by the Coverity checker.
 
Again, check is a pure BS.  Argument passed to this sucker comes from
->Instance of the same struct that had ->Handler equal to mace_interrupt().
That would be
    link->irq.Handler = &mace_interrupt;
    link->irq.Instance = dev;
in nmclan_attach().  Nothing ever modifies that beast afterwards and dev
sure as hell can't be NULL in nmclan_attach() (explict check and a bunch
of dereferencings prior to that point).

Adrian, could you please _read_ the code you are modifying?

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

end of thread, other threads:[~2005-04-13  3:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-13  2:17 [2.6 patch] drivers/net/pcmcia/nmclan_cs.c: fix a check after use Adrian Bunk
2005-04-13  2:53 ` Al Viro
  -- strict thread matches above, loose matches on Subject: below --
2005-03-27 20:44 Adrian Bunk

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