Coverity CID 2330: Spell out that we are going to use the memory we allocated.

This commit is contained in:
christos 2006-04-14 16:26:46 +00:00
parent 1b815db766
commit cd2eb11f45

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhub.c,v 1.77 2005/12/11 12:24:01 christos Exp $ */
/* $NetBSD: uhub.c,v 1.78 2006/04/14 16:26:46 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
/*
@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.77 2005/12/11 12:24:01 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.78 2006/04/14 16:26:46 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -294,7 +294,7 @@ USB_ATTACH(uhub)
* proceed with device attachment
*/
if (UHUB_IS_HIGH_SPEED(sc)) {
if (UHUB_IS_HIGH_SPEED(sc) && nports > 0) {
tts = malloc((UHUB_IS_SINGLE_TT(sc) ? 1 : nports) *
sizeof (struct usbd_tt), M_USBDEV, M_NOWAIT);
if (!tts)