VLAN: Check vlan_desc validity in a failure debug print
The recent VLAN changes added an explicit code path that sets vlan_desc = NULL within ap_sta_set_vlan(). This makes some code analyzers warn about the debug print that could potentially dereference this pointer. Silence that warning by verifying the pointer more consistently within this function. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
43022abdb9
commit
75cc211d6b
1 changed files with 3 additions and 2 deletions
|
@ -900,8 +900,9 @@ int ap_sta_set_vlan(struct hostapd_data *hapd, struct sta_info *sta,
|
||||||
HOSTAPD_MODULE_IEEE80211,
|
HOSTAPD_MODULE_IEEE80211,
|
||||||
HOSTAPD_LEVEL_DEBUG,
|
HOSTAPD_LEVEL_DEBUG,
|
||||||
"could not add dynamic VLAN interface for vlan=%d%s",
|
"could not add dynamic VLAN interface for vlan=%d%s",
|
||||||
vlan_desc->untagged,
|
vlan_desc ? vlan_desc->untagged : -1,
|
||||||
vlan_desc->tagged[0] ? "+" : "");
|
(vlan_desc && vlan_desc->tagged[0]) ?
|
||||||
|
"+" : "");
|
||||||
vlan_id = 0;
|
vlan_id = 0;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto done;
|
goto done;
|
||||||
|
|
Loading…
Reference in a new issue