summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2005-05-23 20:20:36 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2005-05-23 20:20:36 +0000
commit4993920c001a022410f5901621b069ce282724d2 (patch)
treea56cffdb7798ab089d15b9e932e6172053232a91 /sys/arch
parentb2f0277b0bdc5159db04a2b52c7e6480c0371928 (diff)
Avoid potential null pointer dereference.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm/xscale/pxa2x0_i2s.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/arch/arm/xscale/pxa2x0_i2s.c b/sys/arch/arm/xscale/pxa2x0_i2s.c
index 1f50fdf9355..4dfd954eae2 100644
--- a/sys/arch/arm/xscale/pxa2x0_i2s.c
+++ b/sys/arch/arm/xscale/pxa2x0_i2s.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pxa2x0_i2s.c,v 1.2 2005/04/17 03:21:36 pascoe Exp $ */
+/* $OpenBSD: pxa2x0_i2s.c,v 1.3 2005/05/23 20:20:35 pascoe Exp $ */
/*
* Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org>
@@ -311,15 +311,15 @@ pxa2x0_i2s_start_output(struct pxa2x0_i2s_softc *sc, void *block, int bsize,
((caddr_t)block + bsize > p->addr + p->size)); p = p->next)
; /* Nothing */
- /* Offset into block to use in mapped block */
- offset = (caddr_t)block - p->addr;
-
if (!p) {
printf("pxa2x0_i2s_start_output: request with bad start "
"address: %p, size: %d)", block, bsize);
return ENXIO;
}
+ /* Offset into block to use in mapped block */
+ offset = (caddr_t)block - p->addr;
+
/* Start DMA */
pxa2x0_dma_to_fifo(3, 1, 0x40400080, 4, 32,
p->map->dm_segs[0].ds_addr + offset, bsize, intr, intrarg);