Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Fix possible NULL deref. Found by vHCI.



details:   https://anonhg.NetBSD.org/src/rev/ea003a880f56
branches:  trunk
changeset: 459521:ea003a880f56
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Sep 14 15:19:52 2019 +0000

description:
Fix possible NULL deref. Found by vHCI.

diffstat:

 sys/dev/usb/uvisor.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 22d576adcf59 -r ea003a880f56 sys/dev/usb/uvisor.c
--- a/sys/dev/usb/uvisor.c      Sat Sep 14 15:12:12 2019 +0000
+++ b/sys/dev/usb/uvisor.c      Sat Sep 14 15:19:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvisor.c,v 1.51 2019/05/09 02:43:35 mrg Exp $  */
+/*     $NetBSD: uvisor.c,v 1.52 2019/09/14 15:19:52 maxv Exp $ */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvisor.c,v 1.51 2019/05/09 02:43:35 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvisor.c,v 1.52 2019/09/14 15:19:52 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -404,8 +404,9 @@
                        sc->sc_subdevs[i] = NULL;
                }
        }
-
-       usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev);
+       if (sc->sc_udev != NULL)
+               usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
+                   sc->sc_dev);
 
        return rv;
 }



Home | Main Index | Thread Index | Old Index