Skip to content

Commit

Permalink
mwifiex: handle an error path correctly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amitkumar Karwar authored and John W. Linville committed Oct 3, 2011
1 parent d85c5fe commit 44b815c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/wireless/mwifiex/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
adapter->priv_num++;

adapter->priv[0]->adapter = adapter;
if (mwifiex_init_lock_list(adapter))
goto error;
mwifiex_init_lock_list(adapter);

init_timer(&adapter->cmd_timer);
adapter->cmd_timer.function = mwifiex_cmd_timeout_func;
Expand All @@ -87,8 +86,6 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
error:
dev_dbg(adapter->dev, "info: leave mwifiex_register with error\n");

mwifiex_free_lock_list(adapter);

for (i = 0; i < adapter->priv_num; i++)
kfree(adapter->priv[i]);

Expand Down

0 comments on commit 44b815c

Please sign in to comment.