aboutsummaryrefslogtreecommitdiffstats
path: root/caputils/ws80211_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'caputils/ws80211_utils.c')
-rw-r--r--caputils/ws80211_utils.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/caputils/ws80211_utils.c b/caputils/ws80211_utils.c
index 2db068882b..cff2e88d90 100644
--- a/caputils/ws80211_utils.c
+++ b/caputils/ws80211_utils.c
@@ -142,6 +142,21 @@ static int ack_handler(struct nl_msg *msg _U_, void *arg)
static int nl80211_do_cmd(struct nl_msg *msg, struct nl_cb *cb)
{
+ /*
+ * XXX - Coverity doesn't understand how libnl works, so it
+ * doesn't know that nl_recvmsgs() calls the callback, and
+ * that the callback has had a pointer to err registered
+ * with it, and therefore that nl_recvmsgs() can change
+ * err as a side-effect, so it thinks this can loop
+ * infinitely.
+ *
+ * We declare err to be volatile to work around it.
+ *
+ * XXX - that workaround provokes a compiler complaint that
+ * casting a pointer to it to "void *" discards the
+ * volatile qualifier. Perhaps we should just re-close
+ * Coverity CID 997052 as "false positive".
+ */
volatile int err;
if (!nl_state.nl_sock)