From: Larry Finger Date: Wed, 4 Sep 2013 20:56:00 +0000 (-0500) Subject: staging: r8188eu: Fix smatch warning in os_dep/osdep_service.c X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=efbff73ec1caa9a87fff4a5a88db0dd1b9756ede;p=linux-beck.git staging: r8188eu: Fix smatch warning in os_dep/osdep_service.c Smatch reports the following warning: drivers/staging/rtl8188eu/os_dep/osdep_service.c:634 rtw_change_ifname() warn: variable dereferenced before check 'padapter' (see line 630) The dereference in question is deferred until the validity of 'padapter' is verified. Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8188eu/os_dep/osdep_service.c b/drivers/staging/rtl8188eu/os_dep/osdep_service.c index 4e0bfb7e153b..51a1f6f9dbe7 100644 --- a/drivers/staging/rtl8188eu/os_dep/osdep_service.c +++ b/drivers/staging/rtl8188eu/os_dep/osdep_service.c @@ -627,13 +627,14 @@ RETURN: int rtw_change_ifname(struct adapter *padapter, const char *ifname) { struct net_device *pnetdev; - struct net_device *cur_pnetdev = padapter->pnetdev; + struct net_device *cur_pnetdev; struct rereg_nd_name_data *rereg_priv; int ret; if (!padapter) goto error; + cur_pnetdev = padapter->pnetdev; rereg_priv = &padapter->rereg_nd_name_priv; /* free the old_pnetdev */