From efbff73ec1caa9a87fff4a5a88db0dd1b9756ede Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 4 Sep 2013 15:56:00 -0500 Subject: [PATCH] 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 --- drivers/staging/rtl8188eu/os_dep/osdep_service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */ -- 2.30.2