提交 efbff73e 编写于 作者: L Larry Finger 提交者: Greg Kroah-Hartman

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: NLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9b276d2b
...@@ -627,13 +627,14 @@ void rtw_free_netdev(struct net_device *netdev) ...@@ -627,13 +627,14 @@ void rtw_free_netdev(struct net_device *netdev)
int rtw_change_ifname(struct adapter *padapter, const char *ifname) int rtw_change_ifname(struct adapter *padapter, const char *ifname)
{ {
struct net_device *pnetdev; struct net_device *pnetdev;
struct net_device *cur_pnetdev = padapter->pnetdev; struct net_device *cur_pnetdev;
struct rereg_nd_name_data *rereg_priv; struct rereg_nd_name_data *rereg_priv;
int ret; int ret;
if (!padapter) if (!padapter)
goto error; goto error;
cur_pnetdev = padapter->pnetdev;
rereg_priv = &padapter->rereg_nd_name_priv; rereg_priv = &padapter->rereg_nd_name_priv;
/* free the old_pnetdev */ /* free the old_pnetdev */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册