OSDN Git Service

staging: rtl8188eu: remove exit label from rtw_alloc_stainfo
authorMichael Straube <straube.linux@gmail.com>
Sun, 27 Oct 2019 13:06:01 +0000 (14:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Oct 2019 15:40:24 +0000 (16:40 +0100)
Remove exit label from rtw_alloc_stainfo and simply return NULL
instead of goto exit.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20191027130604.68379-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_sta_mgt.c

index 776931b..65a824b 100644 (file)
@@ -181,7 +181,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
                                        struct sta_info, list);
        if (!psta) {
                spin_unlock_bh(&pfree_sta_queue->lock);
-               goto exit;
+               return NULL;
        }
 
        list_del_init(&psta->list);
@@ -194,8 +194,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
        if (index >= NUM_STA) {
                RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_,
                         ("ERROR => %s: index >= NUM_STA", __func__));
-               psta = NULL;
-               goto exit;
+               return NULL;
        }
        phash_list = &pstapriv->sta_hash[index];
 
@@ -246,7 +245,6 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
        /* init for the sequence number of received management frame */
        psta->RxMgmtFrameSeqNum = 0xffff;
 
-exit:
        return psta;
 }