Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb assign nsegs before allocation
details: https://anonhg.NetBSD.org/src/rev/70e042556bb5
branches: trunk
changeset: 784652:70e042556bb5
user: christos <christos%NetBSD.org@localhost>
date: Tue Feb 05 00:41:51 2013 +0000
description:
assign nsegs before allocation
diffstat:
sys/dev/usb/usb_mem.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r faaa5d37c55e -r 70e042556bb5 sys/dev/usb/usb_mem.c
--- a/sys/dev/usb/usb_mem.c Tue Feb 05 00:39:58 2013 +0000
+++ b/sys/dev/usb/usb_mem.c Tue Feb 05 00:41:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_mem.c,v 1.60 2013/02/05 00:39:58 christos Exp $ */
+/* $NetBSD: usb_mem.c,v 1.61 2013/02/05 00:41:51 christos Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.60 2013/02/05 00:39:58 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.61 2013/02/05 00:41:51 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -442,6 +442,7 @@
if (dma->block == NULL)
return USBD_NOMEM;
+ dma->block->nsegs = 1;
dma->block->segs = kmem_alloc(dma->block->nsegs *
sizeof(*dma->block->segs), KM_SLEEP);
if (dma->block->segs == NULL) {
@@ -464,7 +465,6 @@
dma->block->flags = USB_DMA_RESERVE;
dma->block->align = PAGE_SIZE;
dma->block->size = size;
- dma->block->nsegs = 1;
dma->block->segs[0] = rs->map->dm_segs[0];
dma->block->map = rs->map;
dma->block->kaddr = rs->vaddr;
Home |
Main Index |
Thread Index |
Old Index