From: Peng Fan Date: Thu, 2 Jul 2020 08:58:52 +0000 (+0800) Subject: power: supply: rt5033_battery: Fix error code in rt5033_battery_probe() X-Git-Tag: v5.9-rc1~82^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=466bf93153b871f9fed93aea1389673c17d253e7;p=thirdparty%2Flinux.git power: supply: rt5033_battery: Fix error code in rt5033_battery_probe() In the function rt5033_battery_probe(), it should return -ENOMEM instead of -EINVAL when call function devm_kzalloc() failed. Signed-off-by: Peng Fan Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c index d8667a9fc49b1..f330452341f02 100644 --- a/drivers/power/supply/rt5033_battery.c +++ b/drivers/power/supply/rt5033_battery.c @@ -125,7 +125,7 @@ static int rt5033_battery_probe(struct i2c_client *client, battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL); if (!battery) - return -EINVAL; + return -ENOMEM; battery->client = client; battery->regmap = devm_regmap_init_i2c(client,