diff options
Diffstat (limited to 'lib/op-rfkill.c')
-rw-r--r-- | lib/op-rfkill.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/op-rfkill.c b/lib/op-rfkill.c index 5cdf738..08cf4e5 100644 --- a/lib/op-rfkill.c +++ b/lib/op-rfkill.c @@ -95,6 +95,9 @@ int wimaxll_rfkill(struct wimaxll_handle *wmx, enum wimax_rf_state state) struct nl_msg *msg; d_fnstart(3, wmx, "(wmx %p state %u)\n", wmx, state); + result = -EBADF; + if (wmx->ifidx == 0) + goto error_not_any; msg = nlmsg_new(); if (msg == NULL) { result = errno; @@ -126,6 +129,7 @@ error_msg_prep: error_msg_send: nlmsg_free(msg); error_msg_alloc: +error_not_any: d_fnend(3, wmx, "(wmx %p state %u) = %d\n", wmx, state, result); return result; } |