Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aaf2b3af authored by Insu Yun's avatar Insu Yun Committed by Linus Walleij
Browse files

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: default avatarInsu Yun <wuninsu@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 818cc6a5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
		}
	}