[2.6 patch] drivers/infiniband/core/mad.c: fix a NULL pointer dereference

From: Adrian Bunk (bunk_at_stusta.de)
Date: 11/23/05

  • Next message: H. Peter Anvin: "Re: [patch] SMP alternatives"
    Date:	Wed, 23 Nov 2005 23:34:56 +0100
    To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
    
    

    The Coverity checker spotted this obvious NULL pointer dereference
    caused by a wrong order of the cleanups.

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

    ---
    This patch was already sent on:
    - 21 Nov 2005
    --- linux-2.6.15-rc1-mm2-full/drivers/infiniband/core/mad.c.old	2005-11-20 22:04:36.000000000 +0100
    +++ linux-2.6.15-rc1-mm2-full/drivers/infiniband/core/mad.c	2005-11-20 22:05:17.000000000 +0100
    @@ -355,9 +355,9 @@
     	spin_unlock_irqrestore(&port_priv->reg_lock, flags);
     	kfree(reg_req);
     error3:
    -	kfree(mad_agent_priv);
    -error2:
     	ib_dereg_mr(mad_agent_priv->agent.mr);
    +error2:
    +	kfree(mad_agent_priv);
     error1:
     	return ret;
     }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: H. Peter Anvin: "Re: [patch] SMP alternatives"

    Relevant Pages

    • [2.6 patch] drivers/infiniband/core/mad.c: fix a NULL pointer dereference
      ... The Coverity checker spotted this obvious NULL pointer dereference ... caused by a wrong order of the cleanups. ... This patch was already sent on: ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.1-mm1 - OOPs and hangs during modprobe
      ... > Unable to handle kernel NULL pointer dereference at virtual address 00000004 ... > Call Trace: ... The `check for truncated module' patch is clearly triggering when it should ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [2.6 patch] SCSI NCR53C9x.c: some cleanups (fwd)
      ... The patch forwarded below still applies and compiles against ... The patch below contains some cleanups. ... extern int esp_abort; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.15-rc1-mm1
      ... > Unable to handle kernel NULL pointer dereference at virtual address 00000010 ... Begin forwarded message: ... (and it looks like my fault because I sent out a wrong patch). ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [PATCH] cifs: whitespace cleanups for fcntl.c
      ... Here's a patch with cleanups for fs/cifs/fcntl.c ... This time the file is so small and the cleanups so trivial that I chose to ... +int cifs_dir_notify ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)