summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/leds/leds-tca6507.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index 133f89fb7071..ec06a8101e56 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -687,10 +687,9 @@ static int __devinit tca6507_probe(struct i2c_client *client,
NUM_LEDS);
return -ENODEV;
}
- err = -ENOMEM;
tca = kzalloc(sizeof(*tca), GFP_KERNEL);
if (!tca)
- goto exit;
+ return -ENOMEM;
tca->client = client;
INIT_WORK(&tca->work, tca6507_work);
@@ -724,11 +723,10 @@ static int __devinit tca6507_probe(struct i2c_client *client,
return 0;
exit:
- while (i--)
+ while (i--) {
if (tca->leds[i].led_cdev.name)
led_classdev_unregister(&tca->leds[i].led_cdev);
- cancel_work_sync(&tca->work);
- i2c_set_clientdata(client, NULL);
+ }
kfree(tca);
return err;
}