Skip to content

Commit

Permalink
iucv: fix memory leak in cpu hotplug error path.
Browse files Browse the repository at this point in the history
Fix memory leak in error path in CPU_UP_PREPARE notifier.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Akinobu Mita authored and David S. Miller committed Jul 15, 2008
1 parent 0b57664 commit d0236f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/iucv/iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,11 @@ static int __cpuinit iucv_cpu_notify(struct notifier_block *self,
return NOTIFY_BAD;
iucv_param[cpu] = kmalloc_node(sizeof(union iucv_param),
GFP_KERNEL|GFP_DMA, cpu_to_node(cpu));
if (!iucv_param[cpu])
if (!iucv_param[cpu]) {
kfree(iucv_irq_data[cpu]);
iucv_irq_data[cpu] = NULL;
return NOTIFY_BAD;
}
break;
case CPU_UP_CANCELED:
case CPU_UP_CANCELED_FROZEN:
Expand Down

0 comments on commit d0236f8

Please sign in to comment.