summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/ether8139.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-08-21 10:56:15 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-08-21 10:56:15 +0200
commit15755a5f8329aa5395e1bc83231eefad86321ca1 (patch)
tree24845af7628e5ab6b631d42d96e4b4e2fb3a223d /sys/src/9/pc/ether8139.c
parent21618850343af89d5a70f7d53a2ec32066e2ec20 (diff)
ether8139: fix pointer truncation by ulong cast, use mallocalign()
Diffstat (limited to 'sys/src/9/pc/ether8139.c')
-rw-r--r--sys/src/9/pc/ether8139.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/9/pc/ether8139.c b/sys/src/9/pc/ether8139.c
index bffa7956f..f9596ac7d 100644
--- a/sys/src/9/pc/ether8139.c
+++ b/sys/src/9/pc/ether8139.c
@@ -403,7 +403,7 @@ rtl8139init(Ether* edev)
/*
* Receiver
*/
- alloc = (uchar*)ROUNDUP((ulong)ctlr->alloc, 32);
+ alloc = ctlr->alloc;
ctlr->rbstart = alloc;
alloc += ctlr->rblen+16;
memset(ctlr->rbstart, 0, ctlr->rblen+16);
@@ -453,7 +453,7 @@ rtl8139attach(Ether* edev)
qlock(&ctlr->alock);
if(ctlr->alloc == nil){
ctlr->rblen = 1<<((Rblen>>RblenSHIFT)+13);
- ctlr->alloc = mallocz(ctlr->rblen+16 + Ntd*Tdbsz + 32, 0);
+ ctlr->alloc = mallocalign(ctlr->rblen+16 + Ntd*Tdbsz, 32, 0, 0);
if(ctlr->alloc == nil){
qunlock(&ctlr->alock);
error(Enomem);