dm: use strnlen to replace strlen

Tracked-On: #2133
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Shuo A Liu
2018-12-25 10:33:36 +08:00
committed by wenlingz
parent 3e0b06cfd6
commit b3ad44d4c1
14 changed files with 27 additions and 25 deletions

View File

@@ -501,6 +501,7 @@ static int pci_xhci_parse_log_level(struct pci_xhci_vdev *xdev, char *opts);
static int pci_xhci_parse_extcap(struct pci_xhci_vdev *xdev, char *opts);
static int pci_xhci_convert_speed(int lspeed);
#define XHCI_OPT_MAX_LEN 32
static struct pci_xhci_option_elem xhci_option_table[] = {
{"tablet", pci_xhci_parse_tablet},
{"log", pci_xhci_parse_log_level},
@@ -3985,7 +3986,7 @@ pci_xhci_parse_opts(struct pci_xhci_vdev *xdev, char *opts)
if (!n || !f)
continue;
if (!strncmp(t, n, strlen(n))) {
if (!strncmp(t, n, strnlen(n, XHCI_OPT_MAX_LEN))) {
f(xdev, t);
break;
}