Merge pull request #1549 from kernelkit/coverity-findings

This commit is contained in:
Joachim Wiberg
2026-06-27 09:45:11 +02:00
committed by GitHub
4 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -439,7 +439,7 @@ static confd_dependency_t dep_radio_components(struct lyd_node **diff, struct ly
class = lyd_get_value(class_node);
}
if (strcmp(class, "infix-hardware:wifi"))
if (!class || strcmp(class, "infix-hardware:wifi"))
continue;
/* Find all interfaces that reference this radio */
+3 -3
View File
@@ -237,7 +237,7 @@ static const char *wifi_find_higher_band_twin(struct lyd_node *config,
{
struct lyd_node *cifs, *cif;
if (strcmp(current_band, "2.4GHz"))
if (!current_band || !current_ssid || strcmp(current_band, "2.4GHz"))
return NULL;
cifs = lydx_get_descendant(config, "interfaces", "interface", NULL);
@@ -252,13 +252,13 @@ static const char *wifi_find_higher_band_twin(struct lyd_node *config,
if (!ap)
continue;
ssid = lydx_get_cattr(ap, "ssid");
if (strcmp(ssid, current_ssid))
if (!ssid || strcmp(ssid, current_ssid))
continue;
radio = lydx_get_cattr(wifi, "radio");
radio_node = lydx_get_xpathf(config,
"/hardware/component[name='%s']/wifi-radio", radio);
band = lydx_get_cattr(radio_node, "band");
if (!strcmp(band, "5GHz") || !strcmp(band, "6GHz"))
if (band && (!strcmp(band, "5GHz") || !strcmp(band, "6GHz")))
return lydx_get_cattr(cif, "name");
}
+1 -1
View File
@@ -237,7 +237,7 @@ static int netdag_gen_ethtool_autoneg(struct dagger *net, struct lyd_node *cif)
err = -EINVAL;
goto out;
}
if (n != 1) {
if (n != 1 || !forced) {
sr_session_set_error_message(net->session,
"%s: auto-negotiation/enable=false requires exactly one "
"advertised-pmd-types entry (have %d)", ifname, n);
+3 -3
View File
@@ -283,7 +283,7 @@ static int wifi_center_chan_160(int ch)
*/
static int wifi_chan_to_freq(int channel, const char *band)
{
if (!strcmp(band, "6GHz"))
if (band && !strcmp(band, "6GHz"))
return 5950 + channel * 5;
if (channel >= 1 && channel <= 13)
@@ -392,7 +392,7 @@ int wifi_gen_mesh(struct lyd_node *cif)
int center = wifi_center_chan_80(channel);
fprintf(wpa_supplicant, " ht40=1\n");
if (!strcmp(band, "6GHz"))
if (band && !strcmp(band, "6GHz"))
fprintf(wpa_supplicant, " he=1\n");
else
fprintf(wpa_supplicant, " vht=1\n");
@@ -403,7 +403,7 @@ int wifi_gen_mesh(struct lyd_node *cif)
int center = wifi_center_chan_160(channel);
fprintf(wpa_supplicant, " ht40=1\n");
if (!strcmp(band, "6GHz"))
if (band && !strcmp(band, "6GHz"))
fprintf(wpa_supplicant, " he=1\n");
else
fprintf(wpa_supplicant, " vht=1\n");