mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
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>
This commit is contained in:
parent
80e3e241fa
commit
f96b36c779
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue