linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, slapin@ossfans.org
Subject: [PATCH 2/3] nl802154: fix Oops in ieee802154_nl_get_dev
Date: Mon, 29 Jun 2009 19:02:14 +0400	[thread overview]
Message-ID: <1246287735-2692-3-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1246287735-2692-2-git-send-email-dbaryshkov@gmail.com>

ieee802154_nl_get_dev() lacks check for the existance of the device
that was returned by dev_get_XXX, thus resulting in Oops for non-existing
devices. Fix it.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 net/ieee802154/netlink.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c
index 105ad10..332b947 100644
--- a/net/ieee802154/netlink.c
+++ b/net/ieee802154/netlink.c
@@ -276,6 +276,9 @@ static struct net_device *ieee802154_nl_get_dev(struct genl_info *info)
 	else
 		return NULL;
 
+	if (!dev)
+		return NULL;
+
 	if (dev->type != ARPHRD_IEEE802154) {
 		dev_put(dev);
 		return NULL;
-- 
1.6.3.1


  reply	other threads:[~2009-06-29 15:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-29 15:02 [GIT PULL] Fixes for the IEEE 802.15.4 code Dmitry Eremin-Solenikov
2009-06-29 15:02 ` [PATCH 1/3] MAINTAINERS: ieee802154 lists are moderated for non-subscribers Dmitry Eremin-Solenikov
2009-06-29 15:02   ` Dmitry Eremin-Solenikov [this message]
2009-06-29 15:02     ` [PATCH 3/3] nl802154: add module license and description Dmitry Eremin-Solenikov
2009-06-30  2:24 ` [GIT PULL] Fixes for the IEEE 802.15.4 code David Miller

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=1246287735-2692-3-git-send-email-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=slapin@ossfans.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;
as well as URLs for NNTP newsgroup(s).