public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: netdev@vger.kernel.org
Subject: potential null dereference in proto_register()
Date: Tue, 2 Jun 2009 11:50:52 +0300 (EAT)	[thread overview]
Message-ID: <alpine.DEB.2.00.0905271607370.11440@bicker> (raw)

There is a potential null dereference in proto_register() 
from net/core/sock.c

prot->rsk_prot can be null on line 2161 but we dereference it on line 
2167.

  2161  out_free_request_sock_slab:
  2162          if (prot->rsk_prot && prot->rsk_prot->slab) {
  2163                  kmem_cache_destroy(prot->rsk_prot->slab);
  2164                  prot->rsk_prot->slab = NULL;
  2165          }
  2166  out_free_request_sock_slab_name:
  2167          kfree(prot->rsk_prot->slab_name);

Found by smatch.

regards,
dan carpenter


             reply	other threads:[~2009-06-02  9:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02  8:50 Dan Carpenter [this message]
2009-06-02  9:54 ` potential null dereference in proto_register() David Miller
2009-06-03 11:47   ` Jarek Poplawski

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=alpine.DEB.2.00.0905271607370.11440@bicker \
    --to=error27@gmail.com \
    --cc=netdev@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox