aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@cs.washington.edu>2006-11-08 22:49:15 -0500
committerJeff Garzik <jeff@garzik.org>2006-11-10 11:08:53 -0500
commit92b1f905637bbd79fcd430a09737fd97061eb405 (patch)
tree93ef60a2e6977d206462d14901d13c1cbf0f4a9b /drivers/net
parentace48ffb5d6c927c5a98048d93543e1cae0eebd0 (diff)
[PATCH] drivers cris: return on NULL dev_alloc_skb()
If the next descriptor array entry cannot be allocated by dev_alloc_skb(), return immediately so it is not dereferenced later. We cannot register the device with a partial descriptor list. Cc: Mikael Starvik <starvik@axis.com> Signed-off-by: David Rientjes <rientjes@cs.washington.edu> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/cris/eth_v10.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 966b563e42bb..a03d781f6d0a 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -509,6 +509,8 @@ etrax_ethernet_init(void)
509 * does not share cacheline with any other data (to avoid cache bug) 509 * does not share cacheline with any other data (to avoid cache bug)
510 */ 510 */
511 RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES); 511 RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES);
512 if (!RxDescList[i].skb)
513 return -ENOMEM;
512 RxDescList[i].descr.ctrl = 0; 514 RxDescList[i].descr.ctrl = 0;
513 RxDescList[i].descr.sw_len = MAX_MEDIA_DATA_SIZE; 515 RxDescList[i].descr.sw_len = MAX_MEDIA_DATA_SIZE;
514 RxDescList[i].descr.next = virt_to_phys(&RxDescList[i + 1]); 516 RxDescList[i].descr.next = virt_to_phys(&RxDescList[i + 1]);