Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: SGI-IP27: Free some unused memory

platform_device_add_data() duplicates the memory it is passed. So we can
free some memory to save a few bytes that would remain unused otherwise.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Christophe JAILLET and committed by
Thomas Bogendoerfer
33d70856 b2d229d4

+4
+4
arch/mips/sgi-ip27/ip27-xtalk.c
··· 53 53 } 54 54 platform_device_add_resources(pdev, &w1_res, 1); 55 55 platform_device_add_data(pdev, wd, sizeof(*wd)); 56 + /* platform_device_add_data() duplicates the data */ 57 + kfree(wd); 56 58 platform_device_add(pdev); 57 59 58 60 bd = kzalloc(sizeof(*bd), GFP_KERNEL); ··· 85 83 bd->io_offset = offset; 86 84 87 85 platform_device_add_data(pdev, bd, sizeof(*bd)); 86 + /* platform_device_add_data() duplicates the data */ 87 + kfree(bd); 88 88 platform_device_add(pdev); 89 89 pr_info("xtalk:n%d/%x bridge widget\n", nasid, widget); 90 90 return;