From: Claudiu Beznea Date: Wed, 23 Mar 2016 18:37:26 +0000 (+0200) Subject: Staging: wlan-ng: wiphy_free() is not called in case wiphy_register() fails X-Git-Tag: v4.7-rc1~90^2~544 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f96b36c779f92328bb1c802e6268609191d4449d;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Greg Kroah-Hartman --- 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; }