@@ -3336,21 +3336,21 @@ static int mxt_configure_objects(struct mxt_data *data,
error = mxt_init_t7_power_cfg(data);
if (error) {
dev_err(dev, "Failed to initialize power cfg\n");
- goto err_free_object_table;
+ return error;
}
if (cfg) {
error = mxt_update_cfg(data, cfg);
if (error) {
dev_warn(dev, "Error %d updating config\n", error);
- goto err_free_object_table;
+ return error;
}
}
if (data->multitouch) {
error = mxt_initialize_input_device(data);
if (error)
- goto err_free_object_table;
+ return error;
} else {
dev_warn(dev, "No touch object detected\n");
}
@@ -3358,10 +3358,6 @@ static int mxt_configure_objects(struct mxt_data *data,
mxt_debug_init(data);
return 0;
-
-err_free_object_table:
- mxt_free_object_table(data);
- return error;
}
/* Configuration crc check sum is returned as hex xxxxxx */
@@ -4106,16 +4102,21 @@ static int mxt_probe(struct i2c_client *client, const struct i2c_device_id *id)
error = mxt_initialize(data);
if (error)
- return error;
+ goto err_free_object;
error = sysfs_create_group(&client->dev.kobj, &mxt_fw_attr_group);
if (error) {
dev_err(&client->dev, "Failure %d creating fw sysfs group\n",
error);
- return error;
+ goto err_free_object;
}
return 0;
+
+err_free_object:
+ mxt_free_input_device(data);
+ mxt_free_object_table(data);
+ return error;
}
static int mxt_remove(struct i2c_client *client)