Skip to content

Commit

Permalink
staging:iio:magnetometer:ak8975: Fix probe() error-handling
Browse files Browse the repository at this point in the history
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: Stephen Warren <swarren@nvidia.com>
Acked-by: Andrew Chew <achew@nvidia.com>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Stephen Warren authored and Greg Kroah-Hartman committed Sep 27, 2011
1 parent 7c6c936 commit ad31d25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/magnetometer/ak8975.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ad31d25

Please sign in to comment.