diff options
author | Bing Zhao <bzhao@marvell.com> | 2013-03-06 16:44:26 -0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-03-08 16:02:48 -0500 |
commit | c678fb2a915b71f8faa78d9ab6d409b8ff3276cc (patch) | |
tree | 074b9864a203dfaf139d9c9e65ca02bdb594c14f /drivers/net/wireless/mwifiex | |
parent | 8908c7d5392671610a2d80107845d4aeee92d9c1 (diff) |
mwifiex: fix potential null dereference 'mef_entry'
drivers/net/wireless/mwifiex/cfg80211.c:2357 mwifiex_cfg80211_suspend()
error: potential null dereference 'mef_entry'
(kzalloc returns null)
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index df30107225f..c9bc5f5ba6e 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c @@ -2350,9 +2350,12 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy, return 0; } + mef_entry = kzalloc(sizeof(*mef_entry), GFP_KERNEL); + if (!mef_entry) + return -ENOMEM; + memset(&mef_cfg, 0, sizeof(mef_cfg)); mef_cfg.num_entries = 1; - mef_entry = kzalloc(sizeof(*mef_entry), GFP_KERNEL); mef_cfg.mef_entry = mef_entry; mef_entry->mode = MEF_MODE_HOST_SLEEP; mef_entry->action = MEF_ACTION_ALLOW_AND_WAKEUP_HOST; |