We introduced some new locking here, but need to update the error
paths so they unlock before returning.
Fixes:
72d9cd9cdc18 ("power: bq25890: protect view of the chip's state")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
ret = bq25890_get_chip_state(bq, &bq->state);
if (ret < 0)
- return ret;
+ goto unlock;
/* Re-enable ADC only if charger is plugged in. */
if (bq->state.online) {
ret = bq25890_field_write(bq, F_CONV_START, 1);
if (ret < 0)
- return ret;
+ goto unlock;
}
/* signal userspace, maybe state changed while suspended */
power_supply_changed(bq->charger);
+unlock:
mutex_unlock(&bq->lock);
- return 0;
+ return ret;
}
#endif