Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);