Commit e7108e9c authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] epca janitor work

o check request_region result
o Handle failure gracefully
parent 7e42b536
...@@ -2022,7 +2022,8 @@ static void post_fep_init(unsigned int crd) ...@@ -2022,7 +2022,8 @@ static void post_fep_init(unsigned int crd)
(*(ushort *)((ulong)memaddr + XEPORTS) < 3)) (*(ushort *)((ulong)memaddr + XEPORTS) < 3))
shrinkmem = 1; shrinkmem = 1;
if (bd->type < PCIXEM) if (bd->type < PCIXEM)
request_region((int)bd->port, 4, board_desc[bd->type]); if (!request_region((int)bd->port, 4, board_desc[bd->type]))
return;
memwinon(bd, 0); memwinon(bd, 0);
...@@ -2186,9 +2187,13 @@ static void post_fep_init(unsigned int crd) ...@@ -2186,9 +2187,13 @@ static void post_fep_init(unsigned int crd)
if (!(ch->tmp_buf)) if (!(ch->tmp_buf))
{ {
printk(KERN_ERR "POST FEP INIT : kmalloc failed for port 0x%x\n",i); printk(KERN_ERR "POST FEP INIT : kmalloc failed for port 0x%x\n",i);
release_region((int)bd->port, 4);
while(i-- > 0)
kfree((ch--)->tmp_buf);
return;
} }
memset((void *)ch->tmp_buf,0,ch->txbufsize); else
memset((void *)ch->tmp_buf,0,ch->txbufsize);
} /* End for each port */ } /* End for each port */
printk(KERN_INFO printk(KERN_INFO
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment