Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Don't tell userland about ENETRESET even if a us...



details:   https://anonhg.NetBSD.org/src/rev/c86705031518
branches:  trunk
changeset: 844184:c86705031518
user:      maya <maya%NetBSD.org@localhost>
date:      Wed Aug 07 10:01:05 2019 +0000

description:
Don't tell userland about ENETRESET even if a usbnet driver didn't define
un_ioctl_cb.

diffstat:

 sys/dev/usb/usbnet.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r f20c6478c81b -r c86705031518 sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c      Wed Aug 07 09:49:40 2019 +0000
+++ b/sys/dev/usb/usbnet.c      Wed Aug 07 10:01:05 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usbnet.c,v 1.8 2019/08/07 01:47:18 mrg Exp $   */
+/*     $NetBSD: usbnet.c,v 1.9 2019/08/07 10:01:05 maya Exp $  */
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.8 2019/08/07 01:47:18 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.9 2019/08/07 10:01:05 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -817,8 +817,12 @@
                return (*un->un_override_ioctl_cb)(ifp, cmd, data);
 
        error = ether_ioctl(ifp, cmd, data);
-       if (error == ENETRESET && un->un_ioctl_cb)
-               error = (*un->un_ioctl_cb)(ifp, cmd, data);
+       if (error == ENETRESET) {
+               if (un->un_ioctl_cb)
+                       error = (*un->un_ioctl_cb)(ifp, cmd, data);
+               else
+                       error = 0;
+       }
 
        return error;
 }



Home | Main Index | Thread Index | Old Index