diff options
author | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-05-23 20:20:36 +0000 |
---|---|---|
committer | Christopher Pascoe <pascoe@cvs.openbsd.org> | 2005-05-23 20:20:36 +0000 |
commit | 4993920c001a022410f5901621b069ce282724d2 (patch) | |
tree | a56cffdb7798ab089d15b9e932e6172053232a91 /sys/arch | |
parent | b2f0277b0bdc5159db04a2b52c7e6480c0371928 (diff) |
Avoid potential null pointer dereference.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm/xscale/pxa2x0_i2s.c | 8 |
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); |