Skip to content

Commit

Permalink
ia64: sn: Use kmemdup rather than duplicating its implementation
Browse files Browse the repository at this point in the history
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Thomas Meyer authored and Tony Luck committed Dec 9, 2011
1 parent ac0d1a4 commit b82a3ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions arch/ia64/sn/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,11 @@ struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info,
* PROM does not support SAL_INTR_REDIRECT, or it failed.
* Revert to old method.
*/
new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC);
new_irq_info = kmemdup(sn_irq_info, sizeof(struct sn_irq_info),
GFP_ATOMIC);
if (new_irq_info == NULL)
return NULL;

memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info));

/* Free the old PROM new_irq_info structure */
sn_intr_free(local_nasid, local_widget, new_irq_info);
unregister_intr_pda(new_irq_info);
Expand Down

0 comments on commit b82a3ec

Please sign in to comment.