提交 89e84eea 编写于 作者: B Barry Song 提交者: Mike Frysinger

Blackfin: add some bounds checking to peripheral_request

The requested peripheral is turned into an index into some state arrays,
so make sure the calculated index doesn't exceed the index.  This occurs
when using bogus pin values or the define headers are screwed up.  Now
we'll notice right away that something needs fixing instead of trying to
track down random memory corruption.
Signed-off-by: NBarry Song <barry.song@analog.com>
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
上级 29857124
......@@ -762,6 +762,8 @@ int peripheral_request(unsigned short per, const char *label)
if (!(per & P_DEFINED))
return -ENODEV;
BUG_ON(ident >= MAX_RESOURCES);
local_irq_save_hw(flags);
/* If a pin can be muxed as either GPIO or peripheral, make
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册