summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_pf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/usb_pf.c')
-rw-r--r--sys/dev/usb/usb_pf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_pf.c b/sys/dev/usb/usb_pf.c
index 4c88051..b7b29d7 100644
--- a/sys/dev/usb/usb_pf.c
+++ b/sys/dev/usb/usb_pf.c
@@ -129,7 +129,7 @@ usbpf_ifname2ubus(const char *ifname)
int unit;
int error;
- if (strncmp(ifname, USBUSNAME, sizeof(USBUSNAME)) <= 0)
+ if (strncmp(ifname, USBUSNAME, sizeof(USBUSNAME) - 1) != 0)
return (NULL);
error = ifc_name2unit(ifname, &unit);
if (error || unit < 0)
@@ -167,8 +167,10 @@ usbpf_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
struct usb_bus *ubus;
error = ifc_name2unit(name, &unit);
- if (error || unit < 0)
+ if (error)
return (error);
+ if (unit < 0)
+ return (EINVAL);
ubus = usbpf_ifname2ubus(name);
if (ubus == NULL)
OpenPOWER on IntegriCloud