summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wlan-ng/cfg80211.c
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea@gmail.com>2016-03-23 20:37:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-28 07:30:36 -0700
commitf96b36c779f92328bb1c802e6268609191d4449d (patch)
tree2c0f545ba62048093c04fb974fae4ed020b64026 /drivers/staging/wlan-ng/cfg80211.c
parent80e3e241fa56312f7a837b7e4781ecffed0b8db6 (diff)
downloadop-kernel-dev-f96b36c779f92328bb1c802e6268609191d4449d.zip
op-kernel-dev-f96b36c779f92328bb1c802e6268609191d4449d.tar.gz
Staging: wlan-ng: wiphy_free() is not called in case wiphy_register() fails
This patch covers wiphy_register() failures in wlan_create_wiphy() from cfg80211.c by calling wiphy_free() for the correspondent struct wiphy allocated structure. Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wlan-ng/cfg80211.c')
-rw-r--r--drivers/staging/wlan-ng/cfg80211.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c
index 8bad018..ee989d1 100644
--- a/drivers/staging/wlan-ng/cfg80211.c
+++ b/drivers/staging/wlan-ng/cfg80211.c
@@ -771,8 +771,10 @@ static struct wiphy *wlan_create_wiphy(struct device *dev, wlandevice_t *wlandev
wiphy->n_cipher_suites = PRISM2_NUM_CIPHER_SUITES;
wiphy->cipher_suites = prism2_cipher_suites;
- if (wiphy_register(wiphy) < 0)
+ if (wiphy_register(wiphy) < 0) {
+ wiphy_free(wiphy);
return NULL;
+ }
return wiphy;
}
OpenPOWER on IntegriCloud