Bug in sound/dmabuf.c?

From: Jan Evert van Grootheest (janevert@iae.nl)
Date: Fri Apr 21 2000 - 07:33:51 EST


Hello,

I was just reading though some files in drivers/sound and came upon
these few lines.

55
56 static int sound_alloc_dmap(struct dma_buffparms *dmap)
57 {
58 char *start_addr, *end_addr;
59 int i, dma_pagesize;
60 int sz, size;
61
62 dmap->mapping_flags &= ~DMA_MAP_MAPPED;
63
64 if (dmap->raw_buf != NULL)
65 return 0; /* Already done */
66 if (dma_buffsize < 4096)
67 dma_buffsize = 4096;
68 dma_pagesize = (dmap->dma < 4) ? (64 * 1024) : (128 * 1024);

It seems to me that the order of things here is wrong.
In the case that a buffer is already allocated, it will return 0, per
line 65. However, if this buffer was memory mapped, it is still memory
mapped, but in line 62 this was reset. So the rest of the driver will
act like it is not memory mapped.

Is this really the intended behaviour? Then please explain to me why,
since I'm clueless.
Ehm, if this is intended behaviour, perhaps it'd be wise to add a
comment...

Thanks,
Jan Evert


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:18 EST