Skip to contentSkip to conversation

2.6.6 memory allocation checks in eth1394_update()

PATCH New Yury Umanets 1 participant 1 message Jun 6, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.6.6 memory allocation checks in eth1394_update()

Adds memory allocation checks in eth1394_update().

 ./linux-2.6.6-modified/drivers/ieee1394/eth1394.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -rupN ./linux-2.6.6/drivers/ieee1394/eth1394.c ./linux-2.6.6-modified/drivers/ieee1394/eth1394.c
--- ./linux-2.6.6/drivers/ieee1394/eth1394.c Mon May 10 05:32:52 2004
+++ ./linux-2.6.6-modified/drivers/ieee1394/eth1394.c Wed Jun 2
14:19:59 2004
@@ -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);

Signature · 1 line
umka