[patch] bus: sunxi-rsb: unlock on error in sunxi_rsb_read()

Chen-Yu Tsai wens at csie.org
Wed Nov 4 07:28:27 PST 2015


On Wed, Nov 4, 2015 at 6:02 AM, Dan Carpenter <dan.carpenter at oracle.com> wrote:
> Don't forget to unlock before returning an error code.
>
> Fixes: d787dcdb9c8f ('bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus')
> Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>

Acked-by: Chen-Yu Tsai <wens at csie.org>

>
> diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
> index 846bc29c..0cfcb39 100644
> --- a/drivers/bus/sunxi-rsb.c
> +++ b/drivers/bus/sunxi-rsb.c
> @@ -342,13 +342,13 @@ static int sunxi_rsb_read(struct sunxi_rsb *rsb, u8 rtaddr, u8 addr,
>
>         ret = _sunxi_rsb_run_xfer(rsb);
>         if (ret)
> -               goto out;
> +               goto unlock;
>
>         *buf = readl(rsb->regs + RSB_DATA);
>
> +unlock:
>         mutex_unlock(&rsb->lock);
>
> -out:
>         return ret;
>  }
>



More information about the linux-arm-kernel mailing list