[][mt76-vendor: fix coverity errors]
[Description]
Fix some coverity errors for mt76-vendor.
[Release-log]
N/A
Change-Id: Iccc74680df03762d1997a6684a109227aed2b27b
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/5059083
diff --git a/feed/mt76-vendor/src/csi.c b/feed/mt76-vendor/src/csi.c
index 76da857..3c4c6b2 100644
--- a/feed/mt76-vendor/src/csi.c
+++ b/feed/mt76-vendor/src/csi.c
@@ -132,7 +132,7 @@
pos += snprintf(pos, MAX_BUF_SIZE, "%c", '[');
- pos += snprintf(pos, MAX_BUF_SIZE, "%ld,", c->ts);
+ pos += snprintf(pos, MAX_BUF_SIZE, "%d,", c->ts);
pos += snprintf(pos, MAX_BUF_SIZE, "\"%02x%02x%02x%02x%02x%02x\",", c->ta[0], c->ta[1], c->ta[2], c->ta[3], c->ta[4], c->ta[5]);
pos += snprintf(pos, MAX_BUF_SIZE, "%d,", c->rssi);
@@ -171,11 +171,13 @@
fwrite("]", 1, 1, f);
fclose(f);
+
+ return 0;
}
int mt76_csi_dump(int idx, int argc, char **argv)
{
- int pkt_num, ret, i;
+ int pkt_num, ret = 0, i;
struct nl_msg *msg;
void *data;
@@ -227,8 +229,10 @@
void *data;
val = strchr(argv[0], '=');
- if (val)
- *(val++) = 0;
+ if (!val)
+ return -EINVAL;
+
+ *(val++) = 0;
if (!strncmp(argv[0], "ctrl", 4)) {
s1 = s2 = strdup(val);