mwifiex: add a kfree() to an error path
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 21 Sep 2011 07:13:29 +0000 (10:13 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 21 Sep 2011 20:19:44 +0000 (16:19 -0400)
We're not likely to hit this small memory leak, but lets fix it
anyway to keep the static checkers happy.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/sta_ioctl.c

index eb569fa9adbaa5652da67ae297e9e6b8693c0684..215c65ae23ee7013e45b19bc6c6408e7d43bd324 100644 (file)
@@ -203,6 +203,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
                beacon_ie = kmemdup(bss->information_elements,
                                        bss->len_beacon_ies, GFP_KERNEL);
                if (!beacon_ie) {
+                       kfree(bss_desc);
                        dev_err(priv->adapter->dev, " failed to alloc beacon_ie\n");
                        return -ENOMEM;
                }