freebsd-dev/sys
Bill Paul ee755665c2 Fix yet another "unconditionally free()ing memory without even checking
to see if it was malloc()ed first" bug. In bus_dmamap_create(), one of
two things can happen: either we need to allocate a special map due to
some manner of bounce buffering requirement, or we can DMA a buffer
in place. On the x86 platform, the "in place" case results in
bus_dmamap_create() returning a dmamap of NULL. The bus_dmamap_destroy()
routine later checks for NULL and won't bother free()ing the map if
it detects this condition.

But on the alpha, we don't use NULL, we use a statically allocated map
called nobounce_dmamap(). Unfortunately, bus_dmamap_destroy() does not
handle the condition where we attempt to destroy such a map: it tries
to free() the dmamap, which causes a panic.

Fix: test that map != &nobounce_dmamap before trying to free() it.

With this fix, my busdma-ified if_sis driver works on the alpha. I'm
a bit alarmed that I'm the first person ever to trip over this bug, since
we have been using busdma on the alpha for a while, and since it sort
of screams out "Hi! I'm a bug! Booga-booga!" when you look at it.

(Somewhere, somebody will say: "But Bill, why don't you just not bother
destroying the maps in this case." Because the API is supposed to be
a) symetrical and b) opaque to the caller. I can't know whether it's safe
to skip the bus_dmamap_destroy() step or not without sticking my fingers
into unsafe places, which is what I wanted to avoid in the first place.)
2001-08-14 21:56:53 +00:00
..
alpha Fix yet another "unconditionally free()ing memory without even checking 2001-08-14 21:56:53 +00:00
amd64 Use interrupt gates instead of trap gates for breakpoint and trace 2001-08-13 13:22:50 +00:00
arm Don't need the .keep_me files. Obrien and I committed past each other. 2001-07-01 23:35:44 +00:00
boot Spell "FreeBSD" with "F" and "BSD" in uppercase. 2001-08-13 16:33:00 +00:00
cam Eliminate the hot-spare 'r' in Arrray. 2001-08-10 11:47:08 +00:00
coda Warning fix: coda_fbsd.c:113: warning: unused variable `ret' 2001-06-15 00:02:27 +00:00
compat Added the linux_sysinfo function to implement sysinfo(2). 2001-07-23 06:22:10 +00:00
conf Add early code to support interrupts. 2001-08-10 04:48:48 +00:00
contrib fix import/merge related code problems 2001-07-30 10:53:23 +00:00
crypto properly check DES weak key. KAME PR 363. 2001-07-03 17:46:48 +00:00
ddb Quiet a variable format-string warning. 2001-07-19 02:05:00 +00:00
dev Fix an bug in FreeBSD attach routine - attaching MII interfaces before doing 2001-08-13 18:37:31 +00:00
fs linux ls fails on DEVFS /dev because linux_getdents fails because 2001-08-14 06:42:32 +00:00
geom Polish error handling with biofinish(). 2001-05-08 09:10:27 +00:00
gnu Do not depend on pcb_savefpu backwards compat #define. 2001-07-12 12:19:11 +00:00
i4b make driver compile under 4.3-STABLE 2001-07-22 19:55:05 +00:00
i386 Use interrupt gates instead of trap gates for breakpoint and trace 2001-08-13 13:22:50 +00:00
ia64 - Close races with signals and other AST's being triggered while we are in 2001-08-10 22:53:32 +00:00
isa DO NOT ALLOCATE 2+K OBJECTS ON THE KERNEL STACK!!!! 2001-08-10 07:50:14 +00:00
isofs/cd9660 - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION file 2001-05-23 09:42:29 +00:00
kern Add sx_try_upgrade() and sx_downgrade(). 2001-08-13 21:25:30 +00:00
libkern We do not have UPAGES following the tail end of the user VM space anymore. 2001-08-08 04:02:22 +00:00
modules Add support for 802.1Q VLAN and oversized ethernet frames. 2001-08-13 18:32:39 +00:00
net printed current sequence number of the SA. accordingly, changed 2001-08-06 19:40:01 +00:00
netatalk Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
netatm Commited patch for uni signaling fix. 2001-07-11 16:31:50 +00:00
netgraph Pack struct uniqtag declarations to stop our data field from being pushed 2001-08-02 09:28:31 +00:00
netinet Make the protoswitch definitiosn checkable in the same way that 2001-08-10 23:17:22 +00:00
netinet6 Fix unaligned access (fault) on alpha with ndp -p/-r and sysctl -a. 2001-08-10 00:34:20 +00:00
netipx Undo part of the tangle of having sys/lock.h and sys/mutex.h included in 2001-05-01 08:13:21 +00:00
netkey printed current sequence number of the SA. accordingly, changed 2001-08-06 19:40:01 +00:00
netnatm Change a couple of M_WAITOKs used in M_PREPEND() to M_TRYWAITs, which 2001-04-05 04:20:48 +00:00
netncp Fix warning: 203: implicit declaration of function `kernel_sysctlbyname' 2001-06-15 07:37:01 +00:00
netns
netsmb Remove bogus include. 2001-06-14 11:05:01 +00:00
nfs Fix a client-side memory leak in nfs_flush(). The code allocates 2001-08-01 10:25:13 +00:00
nfsclient Fix a client-side memory leak in nfs_flush(). The code allocates 2001-08-01 10:25:13 +00:00
nfsserver With Alfred's permission, remove vm_mtx in favor of a fine-grained approach 2001-07-04 16:20:28 +00:00
pc98 - Close races with signals and other AST's being triggered while we are in 2001-08-10 22:53:32 +00:00
pccard Treat min,max of 0,0 for IRQ special. Reject it if we didn't specifically 2001-08-14 19:23:12 +00:00
pci Fix an bug in FreeBSD attach routine - attaching MII interfaces before doing 2001-08-13 18:37:31 +00:00
posix4 - Close races with signals and other AST's being triggered while we are in 2001-08-10 22:53:32 +00:00
powerpc - Close races with signals and other AST's being triggered while we are in 2001-08-10 22:53:32 +00:00
rpc Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and 2001-03-19 12:50:13 +00:00
sparc64 Add a GENERIC kernel config for sparc64. 2001-08-14 03:27:02 +00:00
svr4
sys Add sx_try_upgrade() and sx_downgrade(). 2001-08-13 21:25:30 +00:00
tools replace calls to non-existant bail() subroutine with calls to 2001-03-23 11:48:50 +00:00
ufs Two recent commits in sys/ufs/ufs interacted badly with ext2fs 2001-07-29 22:26:01 +00:00
vm - Remove asleep(), await(), and M_ASLEEP. 2001-08-10 06:56:12 +00:00
Makefile