public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 4/5] scan: warn on zero frequency when adding to request
Date: Thu, 24 Oct 2024 09:46:34 -0700	[thread overview]
Message-ID: <20241024164635.176631-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20241024164635.176631-1-prestwoj@gmail.com>

This shouldn't ever happen, but if it does we want to alert the user.
---
 src/scan.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/scan.c b/src/scan.c
index 2ffbef6d..c1ccc234 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -292,6 +292,9 @@ static void scan_freq_append(uint32_t freq, void *user_data)
 {
 	struct scan_freq_append_data *data = user_data;
 
+	if (L_WARN_ON(!freq))
+		return;
+
 	l_genl_msg_append_attr(data->msg, data->count++, 4, &freq);
 }
 
-- 
2.34.1


  parent reply	other threads:[~2024-10-24 16:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 16:46 [PATCH 1/5] band: correct oper class 136 starting frequency James Prestwood
2024-10-24 16:46 ` [PATCH 2/5] nl80211util: check band when parsing supported frequencies James Prestwood
2024-10-24 16:46 ` [PATCH 3/5] band: check the operating class band before checking e4 James Prestwood
2024-10-24 16:46 ` James Prestwood [this message]
2024-10-24 17:13   ` [PATCH 4/5] scan: warn on zero frequency when adding to request Denis Kenzior
2024-10-24 16:46 ` [PATCH 5/5] util: warn on invalid channels when iterating a frequency set James Prestwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241024164635.176631-4-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox