[][mii_mgr: fix coverity errors]
[Description]
Fix CERT ERR33-C coverity errors.
Also fix the following CR:
[Release-log]
N/A
Change-Id: I86e00c7f71f1334d95215fcafdec1964882de29e
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/5892517
diff --git a/feed/mii_mgr/src/mii_mgr.c b/feed/mii_mgr/src/mii_mgr.c
index 2ca5071..a22c3e8 100644
--- a/feed/mii_mgr/src/mii_mgr.c
+++ b/feed/mii_mgr/src/mii_mgr.c
@@ -123,17 +123,25 @@
break;
case 'p':
port = strtoul(optarg, NULL, 16);
+ if (port > INT_MAX)
+ return -EINVAL;
break;
case 'd':
dev = strtoul(optarg, NULL, 16);
+ if (dev > INT_MAX)
+ return -EINVAL;
is_cl45 = 1;
break;
case 'r':
reg_num = strtoul(optarg, NULL, 16);
+ if (reg_num > INT_MAX)
+ return -EINVAL;
break;
case 'v':
val = strtoul(optarg, NULL, 16);
+ if (val > INT_MAX)
+ return -EINVAL;
break;
case '?':
show_usage();