serial: max310x: Add error checking in probe()

[ Upstream commit 672a37ba8af1f2ebcedeb94aea2cdd047f805f30 ]

Check if devm_i2c_new_dummy_device() fails.

Fixes: 2e1f2d9a9bdb ("serial: max310x: implement I2C support")
Signed-off-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
Dan Carpenter 2025-08-07 18:54:37 +03:00 • committed by Greg Kroah-Hartman
commit 148aba0be5

View file

@ -1660,6 +1660,8 @@ static int max310x_i2c_probe(struct i2c_client *client)
port_client = devm_i2c_new_dummy_device(&client->dev,
client->adapter,
port_addr);
if (IS_ERR(port_client))
return PTR_ERR(port_client);
regmaps[i] = devm_regmap_init_i2c(port_client, &regcfg_i2c);
}