From 2cd39ed1c86032b57e9b37b4465daa5ccb0b05d6 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 31 Dec 2011 04:38:52 +0100 Subject: [PATCH] kernel: Fix two NULL dereference issues. --- sys/bus/usb/usbdi.c | 4 ++-- sys/netgraph/tty/ng_tty.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/bus/usb/usbdi.c b/sys/bus/usb/usbdi.c index 41184556b8..3b31f3302d 100644 --- a/sys/bus/usb/usbdi.c +++ b/sys/bus/usb/usbdi.c @@ -1,6 +1,5 @@ /* $NetBSD: usbdi.c,v 1.106 2004/10/24 12:52:40 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.91.2.1 2005/12/15 00:36:00 iedowse Exp $ */ -/* $DragonFly: src/sys/bus/usb/usbdi.c,v 1.18 2007/06/29 22:56:31 hasso Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -771,7 +770,7 @@ usb_transfer_complete(usbd_xfer_handle xfer) int sync = xfer->flags & USBD_SYNCHRONOUS; int erred = xfer->status == USBD_CANCELLED || xfer->status == USBD_TIMEOUT; - int repeat = pipe->repeat; + int repeat; int polling; DPRINTFN(5, ("usb_transfer_complete: pipe=%p xfer=%p status=%d " @@ -790,6 +789,7 @@ usb_transfer_complete(usbd_xfer_handle xfer) return; } #endif + repeat = pipe->repeat; polling = pipe->device->bus->use_polling; /* XXXX */ if (polling) diff --git a/sys/netgraph/tty/ng_tty.c b/sys/netgraph/tty/ng_tty.c index c34e130193..5b18de57c8 100644 --- a/sys/netgraph/tty/ng_tty.c +++ b/sys/netgraph/tty/ng_tty.c @@ -344,7 +344,7 @@ static int ngt_input(int c, struct tty *tp) { const sc_p sc = (sc_p) tp->t_sc; - const node_p node = sc->node; + const node_p node = sc ? sc->node : NULL; struct mbuf *m; int error = 0; -- 2.11.4.GIT