diff mbox series

[4/5] scan: warn on zero frequency when adding to request

Message ID 20241024164635.176631-4-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [1/5] band: correct oper class 136 starting frequency | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Oct. 24, 2024, 4:46 p.m. UTC
This shouldn't ever happen, but if it does we want to alert the user.
---
 src/scan.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Denis Kenzior Oct. 24, 2024, 5:13 p.m. UTC | #1
Hi James,

On 10/24/24 11:46 AM, James Prestwood wrote:
> This shouldn't ever happen, but if it does we want to alert the user.
> ---
>   src/scan.c | 3 +++
>   1 file changed, 3 insertions(+)
> 

This patch was redundant due to patch 5, so I dropped this.  The rest applied, 
thanks.

Regards,
-Denis
diff mbox series

Patch

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);
 }