mirror of
https://github.com/hzyitc/openwrt-redmi-ax3000.git
synced 2025-12-17 17:03:27 +00:00
hostapd: add missing NULL pointer check in uc_hostapd_iface_stop
Avoid crashing if the interface has already been removed
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 4145ff4d8a)
This commit is contained in:
parent
6019945e96
commit
eda1545e6e
@ -471,6 +471,9 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs)
|
|||||||
struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
|
struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (!iface)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
switch (iface->state) {
|
switch (iface->state) {
|
||||||
case HAPD_IFACE_ENABLED:
|
case HAPD_IFACE_ENABLED:
|
||||||
case HAPD_IFACE_DISABLED:
|
case HAPD_IFACE_DISABLED:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user