Commit b82a3ecd authored by Thomas Meyer's avatar Thomas Meyer Committed by Tony Luck

ia64: sn: Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.
Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent ac0d1a48
...@@ -150,12 +150,11 @@ struct sn_irq_info *sn_retarget_vector(struct sn_irq_info *sn_irq_info, ...@@ -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. * PROM does not support SAL_INTR_REDIRECT, or it failed.
* Revert to old method. * 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) if (new_irq_info == NULL)
return NULL; return NULL;
memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info));
/* Free the old PROM new_irq_info structure */ /* Free the old PROM new_irq_info structure */
sn_intr_free(local_nasid, local_widget, new_irq_info); sn_intr_free(local_nasid, local_widget, new_irq_info);
unregister_intr_pda(new_irq_info); unregister_intr_pda(new_irq_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment