DORMANTno replies

[PATCH] bfin: check if an empty array pointer is passed to pinmux request API

From: Sonic Zhang <hidden>
Date: 2015-02-05 05:36:49
Subsystem: the rest · Maintainer: Linus Torvalds

From: Sonic Zhang <redacted>

to avoid possible indigestion

Signed-off-by: Sonic Zhang <redacted>
---
 arch/blackfin/kernel/bfin_gpio.c |    4 ++++
 1 file changed, 4 insertions(+)
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index a017359..153841f 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -730,6 +730,8 @@ int peripheral_request_list(const unsigned short per[], const char *label)
 	u16 cnt;
 	int ret;
 
+	if (per == NULL)
+		return -ENODEV;
 	for (cnt = 0; per[cnt] != 0; cnt++) {
 
 		ret = peripheral_request(per[cnt], label);
@@ -778,6 +780,8 @@ EXPORT_SYMBOL(peripheral_free);
 void peripheral_free_list(const unsigned short per[])
 {
 	u16 cnt;
+	if (per == NULL)
+		return;
 	for (cnt = 0; per[cnt] != 0; cnt++)
 		peripheral_free(per[cnt]);
 }
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help