提交 aaf2b3af 编写于 作者: I Insu Yun 提交者: Linus Walleij

gpio-mcp23s08: correctly handling failed allocation

Since devm_kzalloc can be failed in memory pressure,
it needs to check and return -ENOMEM
Signed-off-by: NInsu Yun <wuninsu@gmail.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 818cc6a5
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册