From: Yury Umanets Adds memory allocation checks in eth1394_update(). Signed-off-by: Yury Umanets Signed-off-by: Andrew Morton --- 25-akpm/drivers/ieee1394/eth1394.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletion(-) diff -puN drivers/ieee1394/eth1394.c~266-memory-allocation-checks-in-eth1394_update drivers/ieee1394/eth1394.c --- 25/drivers/ieee1394/eth1394.c~266-memory-allocation-checks-in-eth1394_update 2004-06-07 21:55:30.436764272 -0700 +++ 25-akpm/drivers/ieee1394/eth1394.c 2004-06-07 21:55:30.441763512 -0700 @@ -431,9 +431,12 @@ static int eth1394_update(struct unit_di if (!node) return -ENOMEM; - node_info = kmalloc(sizeof(struct eth1394_node_info), in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); + if (!node_info) { + kfree(node); + return -ENOMEM; + } spin_lock_init(&node_info->pdg.lock); INIT_LIST_HEAD(&node_info->pdg.list); _