* [PATCH] bfin: check if an empty array pointer is passed to pinmux request API
@ 2015-02-05 5:33 Sonic Zhang
0 siblings, 0 replies; only message in thread
From: Sonic Zhang @ 2015-02-05 5:33 UTC (permalink / raw)
To: Steven Miao, adi-buildroot-devel
Cc: Dmitry Torokhov, linux-input, Sonic Zhang
From: Sonic Zhang <sonic.zhang@analog.com>
to avoid possible indigestion
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-02-05 5:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 5:33 [PATCH] bfin: check if an empty array pointer is passed to pinmux request API Sonic Zhang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).