projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
818cc6a
)
gpio-mcp23s08: correctly handling failed allocation
author
Insu Yun
<wuninsu@gmail.com>
Tue, 16 Feb 2016 02:19:57 +0000
(21:19 -0500)
committer
Linus Walleij
<linus.walleij@linaro.org>
Tue, 16 Feb 2016 15:36:22 +0000
(16:36 +0100)
Since devm_kzalloc can be failed in memory pressure,
it needs to check and return -ENOMEM
Signed-off-by: Insu Yun <wuninsu@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mcp23s08.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/gpio/gpio-mcp23s08.c
b/drivers/gpio/gpio-mcp23s08.c
index c767879e4dd9ad14902aebc419c83fc394bd953c..f8d4abcff5738aa4861a7e98e157f5528fca8920 100644
(file)
--- a/
drivers/gpio/gpio-mcp23s08.c
+++ b/
drivers/gpio/gpio-mcp23s08.c
@@
-803,6
+803,8
@@
static int mcp230xx_probe(struct i2c_client *client,
pdata = devm_kzalloc(&client->dev,
sizeof(struct mcp23s08_platform_data),
GFP_KERNEL);
+ if (!pdata)
+ return -ENOMEM;
pdata->base = -1;
}
}