summaryrefslogtreecommitdiff
path: root/lib/op-reset.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/op-reset.c')
-rw-r--r--lib/op-reset.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/op-reset.c b/lib/op-reset.c
index 434d235..0b842b6 100644
--- a/lib/op-reset.c
+++ b/lib/op-reset.c
@@ -89,6 +89,10 @@ int wimaxll_reset(struct wimaxll_handle *wmx)
struct nl_msg *msg;
d_fnstart(3, wmx, "(wmx %p)\n", wmx);
+ result = -EBADF;
+ if (wmx->ifidx == 0)
+ goto error_not_any;
+
msg = nlmsg_new();
if (msg == NULL) {
result = errno;
@@ -119,6 +123,7 @@ error_msg_prep:
error_msg_send:
nlmsg_free(msg);
error_msg_alloc:
+error_not_any:
d_fnend(3, wmx, "(wmx %p) = %d\n", wmx, result);
return result;
}