staging:iio:magnetometer:ak8975: Fix probe() error-handling
authorStephen Warren <swarren@nvidia.com>
Wed, 21 Sep 2011 10:16:01 +0000 (11:16 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 27 Sep 2011 00:31:55 +0000 (17:31 -0700)
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>
drivers/staging/iio/magnetometer/ak8975.c

index 9c5338396d7eb856ba33e5c8f44393ec6c6db43a..ab0e26cbdba0353694f98d144d2caea4925ab826 100644 (file)
@@ -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);