From: Amitkumar Karwar Date: Fri, 30 Sep 2011 03:43:41 +0000 (-0700) Subject: mwifiex: handle an error path correctly X-Git-Tag: v3.2-rc1~129^2~83^2~127 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44b815c6b063ddadacc062a28a3e3facc8486f31;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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 Signed-off-by: Bing Zhao Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index 8b05b4f..8486451 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, 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; @@ -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]);