}
st->indio_dev->available_scan_masks
- = kzalloc(GFP_KERNEL,
- sizeof(*st->indio_dev->available_scan_masks)*
- (st->chip_info->num_modes + 1));
+ = kzalloc(sizeof(*st->indio_dev->available_scan_masks)*
+ (st->chip_info->num_modes + 1), GFP_KERNEL);
if (!st->indio_dev->available_scan_masks) {
ret = -ENOMEM;
goto error_free_device;
if (!IS_ERR(st->reg))
regulator_put(st->reg);
error_free_st:
+ i2c_set_clientdata(client, NULL);
kfree(st);
error_ret:
regulator_disable(st->reg);
regulator_put(st->reg);
}
+ i2c_set_clientdata(client, NULL);
kfree(st);
return 0;