Commit ad31d250 authored by Stephen Warren's avatar Stephen Warren Committed by Greg Kroah-Hartman

staging:iio:magnetometer:ak8975: Fix probe() error-handling

Fix ak8975_probe() to jump to the appropriate exit labels when an error
occurs. With the previous code, some cleanup actions were being skipped
for some error conditions.
Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
Acked-by: default avatarAndrew Chew <achew@nvidia.com>
Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7c6c9368
......@@ -513,7 +513,7 @@ static int ak8975_probe(struct i2c_client *client,
err = ak8975_setup(client);
if (err < 0) {
dev_err(&client->dev, "AK8975 initialization fails\n");
goto exit_gpio;
goto exit_free_iio;
}
i2c_set_clientdata(client, indio_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment