aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/patches-4.1
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2016-04-26 11:43:42 +0000
committerJohn Crispin <blogic@openwrt.org>2016-04-26 11:43:42 +0000
commitd43b701747d57df4cbfcc1f05a7d6fe5692306a0 (patch)
tree299a90f9cc7431ae44a9d15814c3eeec713017ec /target/linux/ar71xx/patches-4.1
parent5d2c014371a02dfe7bcc6af6915822d2695a7148 (diff)
downloadmaster-187ad058-d43b701747d57df4cbfcc1f05a7d6fe5692306a0.tar.gz
master-187ad058-d43b701747d57df4cbfcc1f05a7d6fe5692306a0.tar.bz2
master-187ad058-d43b701747d57df4cbfcc1f05a7d6fe5692306a0.zip
ar71xx: simplify patch 613 and add missing error handling
Dynamic allocation of label can be simplified. Also add error handling to deal with failed memory allocation. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49244 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/patches-4.1')
-rw-r--r--target/linux/ar71xx/patches-4.1/613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch6
1 files changed, 3 insertions, 3 deletions
diff --git a/target/linux/ar71xx/patches-4.1/613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch b/target/linux/ar71xx/patches-4.1/613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch
index a832bf84ce..e8bbe44002 100644
--- a/target/linux/ar71xx/patches-4.1/613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch
+++ b/target/linux/ar71xx/patches-4.1/613-MIPS-ath79-add-ath79_wmac_setup_ext_lna_gpio-helper.patch
@@ -18,12 +18,12 @@
+static int ath79_request_ext_lna_gpio(unsigned chain, int gpio)
+{
-+ char buf[32];
+ char *label;
+ int err;
+
-+ scnprintf(buf, sizeof(buf), "external LNA%u", chain);
-+ label = kstrdup(buf, GFP_KERNEL);
++ label = kasprintf(GFP_KERNEL, "external LNA%u", chain);
++ if (!label)
++ return -ENOMEM;
+
+ err = gpio_request_one(gpio, GPIOF_DIR_OUT | GPIOF_INIT_LOW, label);
+ if (err) {