netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: thomas@wytron.com.tw
Cc: netdev@vger.kernel.org
Subject: null dereference in ethoc_probe()
Date: Sat, 22 May 2010 17:55:47 +0200	[thread overview]
Message-ID: <20100522155455.GE22515@bicker> (raw)

The patch 0baa080c75c: "ethoc: use system memory as buffer" introduced a
potential null dereference.

  1060  free:
  1061          if (priv->dma_alloc)
                    ^^^^^^^^^^^^^^^
	priv can be null here.

  1062                  dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
  1063                          netdev->mem_start);
  1064          free_netdev(netdev);

Also I think the error handling is not as complete as it should be.  It
seems like we should call devm_iounmap() and release some of the other
resources as well.

regards,
dan carpenter


             reply	other threads:[~2010-05-22 15:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-22 15:55 Dan Carpenter [this message]
2010-05-24  0:29 ` null dereference in ethoc_probe() Thomas Chou
2010-05-24  2:44 ` [PATCH] ethoc: fix null dereference in ethoc_probe Thomas Chou
2010-05-24  6:11   ` David Miller
2010-05-25  6:16   ` [Nios2-dev] " Tobias Klauser
2010-05-25  6:51     ` Thomas Chou

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=20100522155455.GE22515@bicker \
    --to=error27@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=thomas@wytron.com.tw \
    /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;
as well as URLs for NNTP newsgroup(s).