Skip to content

Commit

Permalink
[PATCH] sb1250-mac: Ensure 16-byte alignment of the descriptor ring.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 drivers/net/sb1250-mac.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Ralf Baechle authored and Jeff Garzik committed Oct 18, 2005
1 parent f567ef9 commit 04115de
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/net/sb1250-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,14 @@ static void sbdma_initctx(sbmacdma_t *d,
d->sbdma_maxdescr = maxdescr;

d->sbdma_dscrtable = (sbdmadscr_t *)
kmalloc(d->sbdma_maxdescr*sizeof(sbdmadscr_t), GFP_KERNEL);
kmalloc((d->sbdma_maxdescr+1)*sizeof(sbdmadscr_t), GFP_KERNEL);

/*
* The descriptor table must be aligned to at least 16 bytes or the
* MAC will corrupt it.
*/
d->sbdma_dscrtable = (sbdmadscr_t *)
ALIGN((unsigned long)d->sbdma_dscrtable, sizeof(sbdmadscr_t));

memset(d->sbdma_dscrtable,0,d->sbdma_maxdescr*sizeof(sbdmadscr_t));

Expand Down

0 comments on commit 04115de

Please sign in to comment.