[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>

authored by David Rientjes and committed by Jeff Garzik 92b1f905 ace48ffb

+2
+2
drivers/net/cris/eth_v10.c
··· 509 * does not share cacheline with any other data (to avoid cache bug) 510 */ 511 RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES); 512 RxDescList[i].descr.ctrl = 0; 513 RxDescList[i].descr.sw_len = MAX_MEDIA_DATA_SIZE; 514 RxDescList[i].descr.next = virt_to_phys(&RxDescList[i + 1]);
··· 509 * does not share cacheline with any other data (to avoid cache bug) 510 */ 511 RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES); 512 + if (!RxDescList[i].skb) 513 + return -ENOMEM; 514 RxDescList[i].descr.ctrl = 0; 515 RxDescList[i].descr.sw_len = MAX_MEDIA_DATA_SIZE; 516 RxDescList[i].descr.next = virt_to_phys(&RxDescList[i + 1]);