From: Fabio M. De Francesco Date: Sat, 2 Apr 2022 14:06:57 +0000 (+0200) Subject: staging: r8188eu: Remove redundant code from rtw_free_netdev() X-Git-Tag: v6.6.17~7348^2~288 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28f7545d9f08f49d02e02fc1ee556161bfa95a5e;p=platform%2Fkernel%2Flinux-rpi.git staging: r8188eu: Remove redundant code from rtw_free_netdev() In rtw_free_netdev() there are two redundant tests. The first checks for a valid pointer to a "struct net_device". This pointer is the argument of rtw_free_netdev(). The two callers of this function already test this parameter immediatelly before the calls. The second checks for a valid pointer to a "struct rtw_netdev_priv_indicator". This pointer is always valid and, even if it were not, vfree() is a no-op on NULL pointers. Therefore the above-mentioned two "if" statements are unnecessary and redundant. For this reason, remove these two tests. After removing these tests there is no more need of the "RETURN" label. Therefore, remove also the "RETURN" label. Cc: Pavel Skripkin Cc: Martin Kaiser Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220402140657.10549-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/os_dep/osdep_service.c b/drivers/staging/r8188eu/os_dep/osdep_service.c index 7a6fcc9..fc10eefe 100644 --- a/drivers/staging/r8188eu/os_dep/osdep_service.c +++ b/drivers/staging/r8188eu/os_dep/osdep_service.c @@ -116,19 +116,10 @@ void rtw_free_netdev(struct net_device *netdev) { struct rtw_netdev_priv_indicator *pnpi; - if (!netdev) - goto RETURN; - pnpi = netdev_priv(netdev); - if (!pnpi->priv) - goto RETURN; - vfree(pnpi->priv); free_netdev(netdev); - -RETURN: - return; } int rtw_change_ifname(struct adapter *padapter, const char *ifname)