diff options
author | Amitkumar Karwar <akarwar@marvell.com> | 2011-09-29 23:43:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-10-03 15:22:36 -0400 |
commit | 44b815c6b063ddadacc062a28a3e3facc8486f31 (patch) | |
tree | 171ac8deb41426c1f07dac9c5303175310209512 /drivers/net/wireless/mwifiex/main.c | |
parent | d85c5fe462fe3531f607fda787e9c80617e35437 (diff) |
mwifiex: handle an error path correctly
In failure case locks are not allocated in mwifiex_register().
So mwifiex_free_lock_list() routine call becomes redundant.
Also we don't need to check return type for mwifiex_init_lock_list()
routine. It never fails.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.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/main.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 8b05b4f5ffe2..848645118ad4 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -75,8 +75,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, | |||
75 | adapter->priv_num++; | 75 | adapter->priv_num++; |
76 | 76 | ||
77 | adapter->priv[0]->adapter = adapter; | 77 | adapter->priv[0]->adapter = adapter; |
78 | if (mwifiex_init_lock_list(adapter)) | 78 | mwifiex_init_lock_list(adapter); |
79 | goto error; | ||
80 | 79 | ||
81 | init_timer(&adapter->cmd_timer); | 80 | init_timer(&adapter->cmd_timer); |
82 | adapter->cmd_timer.function = mwifiex_cmd_timeout_func; | 81 | adapter->cmd_timer.function = mwifiex_cmd_timeout_func; |
@@ -87,8 +86,6 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, | |||
87 | error: | 86 | error: |
88 | dev_dbg(adapter->dev, "info: leave mwifiex_register with error\n"); | 87 | dev_dbg(adapter->dev, "info: leave mwifiex_register with error\n"); |
89 | 88 | ||
90 | mwifiex_free_lock_list(adapter); | ||
91 | |||
92 | for (i = 0; i < adapter->priv_num; i++) | 89 | for (i = 0; i < adapter->priv_num; i++) |
93 | kfree(adapter->priv[i]); | 90 | kfree(adapter->priv[i]); |
94 | 91 | ||