Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92b1f905 authored by David Rientjes's avatar David Rientjes Committed by Jeff Garzik
Browse files

[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: default avatarDavid Rientjes <rientjes@cs.washington.edu>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent ace48ffb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -509,6 +509,8 @@ etrax_ethernet_init(void)
		 * does not share cacheline with any other data (to avoid cache bug)
		 */
		RxDescList[i].skb = dev_alloc_skb(MAX_MEDIA_DATA_SIZE + 2 * L1_CACHE_BYTES);
		if (!RxDescList[i].skb)
			return -ENOMEM;
		RxDescList[i].descr.ctrl   = 0;
		RxDescList[i].descr.sw_len = MAX_MEDIA_DATA_SIZE;
		RxDescList[i].descr.next   = virt_to_phys(&RxDescList[i + 1]);