All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: rolandd@cisco.com, mshefty@ichips.intel.com, halr@voltaire.com
Cc: openib-general@openib.org, linux-kernel@vger.kernel.org,
	stable@kernel.org
Subject: [2.6 patch] drivers/infiniband/core/mad.c: fix a NULL pointer dereference
Date: Mon, 21 Nov 2005 00:14:11 +0100	[thread overview]
Message-ID: <20051120231411.GF16060@stusta.de> (raw)

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>

--- 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;
 }


         reply	other threads:[~2005-11-20 23:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-20 23:00 [2.6 patch] drivers/scsi/dpt_i2o.c: fix a NULL pointer dereference Adrian Bunk
2005-11-20 23:08 ` [2.6 patch] drivers/message/i2o/pci.c: " Adrian Bunk
2005-11-20 23:14   ` Adrian Bunk [this message]
2005-11-21  0:24     ` [stable] [2.6 patch] drivers/infiniband/core/mad.c: " Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2005-11-23 22:34 Adrian Bunk
2005-11-26 23:37 Adrian Bunk
2005-11-27 23:51 ` Roland Dreier
2005-11-28  0:25   ` Adrian Bunk
2005-11-28 17:59     ` Roland Dreier
2005-11-29 12:30       ` Adrian Bunk
2005-11-29 17:07         ` Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051120231411.GF16060@stusta.de \
    --to=bunk@stusta.de \
    --cc=halr@voltaire.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mshefty@ichips.intel.com \
    --cc=openib-general@openib.org \
    --cc=rolandd@cisco.com \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.