From 71468b33ee1292458e0db3c5e97fbdde48dfea42 Mon Sep 17 00:00:00 2001 From: Denis Kirjanov Date: Sun, 23 May 2010 05:45:45 +0000 Subject: [PATCH] --- yaml --- r: 198573 b: refs/heads/master c: a6c0f8217c17d46da22fa56923f3cbd03615cb7c h: refs/heads/master i: 198571: 9aada9ae163d92dd9fca83da7eb520263c9dfb75 v: v3 --- [refs] | 2 +- trunk/net/ieee802154/wpan-class.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 07b031d9029e..031e2d6cf63f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 418c437d8b4b87815f3afed89da2aa0078d5379d +refs/heads/master: a6c0f8217c17d46da22fa56923f3cbd03615cb7c diff --git a/trunk/net/ieee802154/wpan-class.c b/trunk/net/ieee802154/wpan-class.c index 3d803a1b9fb6..1627ef2e8522 100644 --- a/trunk/net/ieee802154/wpan-class.c +++ b/trunk/net/ieee802154/wpan-class.c @@ -147,13 +147,15 @@ struct wpan_phy *wpan_phy_alloc(size_t priv_size) struct wpan_phy *phy = kzalloc(sizeof(*phy) + priv_size, GFP_KERNEL); + if (!phy) + goto out; mutex_lock(&wpan_phy_mutex); phy->idx = wpan_phy_idx++; if (unlikely(!wpan_phy_idx_valid(phy->idx))) { wpan_phy_idx--; mutex_unlock(&wpan_phy_mutex); kfree(phy); - return NULL; + goto out; } mutex_unlock(&wpan_phy_mutex); @@ -168,6 +170,9 @@ struct wpan_phy *wpan_phy_alloc(size_t priv_size) phy->current_page = 0; /* for compatibility */ return phy; + +out: + return NULL; } EXPORT_SYMBOL(wpan_phy_alloc);