diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-11-16 07:18:37 +0000 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2015-11-16 07:18:37 +0000 |
commit | f8692a4b88893a47ac3e49261c242b9a63a11175 (patch) | |
tree | 360af83203b9aba4b32a06ed65d94d5f51a717f4 /target/linux/brcm47xx/patches-4.1/032-01-MIPS-BCM47xx-Use-kmemdup-rather-than-duplicating-its.patch | |
parent | b2dab45aa776f8cacef8606af05cc657c8f99323 (diff) | |
download | upstream-f8692a4b88893a47ac3e49261c242b9a63a11175.tar.gz upstream-f8692a4b88893a47ac3e49261c242b9a63a11175.tar.bz2 upstream-f8692a4b88893a47ac3e49261c242b9a63a11175.zip |
brcm47xx: backport BCM47xx MIPS commits from 4.3 and 4.4-rc1
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 47484
Diffstat (limited to 'target/linux/brcm47xx/patches-4.1/032-01-MIPS-BCM47xx-Use-kmemdup-rather-than-duplicating-its.patch')
-rw-r--r-- | target/linux/brcm47xx/patches-4.1/032-01-MIPS-BCM47xx-Use-kmemdup-rather-than-duplicating-its.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-4.1/032-01-MIPS-BCM47xx-Use-kmemdup-rather-than-duplicating-its.patch b/target/linux/brcm47xx/patches-4.1/032-01-MIPS-BCM47xx-Use-kmemdup-rather-than-duplicating-its.patch new file mode 100644 index 0000000000..958738c35c --- /dev/null +++ b/target/linux/brcm47xx/patches-4.1/032-01-MIPS-BCM47xx-Use-kmemdup-rather-than-duplicating-its.patch @@ -0,0 +1,48 @@ +From e5dd8f2cf65cb228fad881ecd35093d8409d17c6 Mon Sep 17 00:00:00 2001 +From: Andrzej Hajda <a.hajda@samsung.com> +Date: Fri, 7 Aug 2015 09:59:10 +0200 +Subject: [PATCH] MIPS: BCM47xx: Use kmemdup rather than duplicating its + implementation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The patch was generated using fixed coccinelle semantic patch +scripts/coccinelle/api/memdup.cocci [1]. + +[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 + +Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> +Acked-by: Hauke Mehrtens <hauke@hauke-m.de> +Cc: Hauke Mehrtens <hauke@hauke-m.de> +Cc: Rafał Miłecki <zajec5@gmail.com> +Cc: Andrzej Hajda <a.hajda@samsung.com> +Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> +Cc: Marek Szyprowski <m.szyprowski@samsung.com> +Cc: linux-kernel@vger.kernel.org +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/10898/ +Signed-off-by: Ralf Baechle <ralf@linux-mips.org> +--- + arch/mips/bcm47xx/buttons.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/arch/mips/bcm47xx/buttons.c b/arch/mips/bcm47xx/buttons.c +index 08a4abf..52caa75 100644 +--- a/arch/mips/bcm47xx/buttons.c ++++ b/arch/mips/bcm47xx/buttons.c +@@ -396,10 +396,9 @@ static int __init bcm47xx_buttons_copy(const struct gpio_keys_button *buttons, + { + size_t size = nbuttons * sizeof(*buttons); + +- bcm47xx_button_pdata.buttons = kmalloc(size, GFP_KERNEL); ++ bcm47xx_button_pdata.buttons = kmemdup(buttons, size, GFP_KERNEL); + if (!bcm47xx_button_pdata.buttons) + return -ENOMEM; +- memcpy(bcm47xx_button_pdata.buttons, buttons, size); + bcm47xx_button_pdata.nbuttons = nbuttons; + + return 0; +-- +1.8.4.5 + |