From: Greg Kroah-Hartman Date: Tue, 4 May 2010 23:06:33 +0000 (-0700) Subject: Staging: comedi: das1800.c: fix a locking error on the error path. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d18c5906d0914d911a13d342ff61a6bca6aff597;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Staging: comedi: das1800.c: fix a locking error on the error path. Cc: Ian Abbott Cc: Frank Mori Hess Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c index d91c2d9d595b..de5e82fec878 100644 --- a/drivers/staging/comedi/drivers/das1800.c +++ b/drivers/staging/comedi/drivers/das1800.c @@ -1637,7 +1637,8 @@ static int das1800_ai_rinsn(struct comedi_device *dev, } if (i == timeout) { comedi_error(dev, "timeout"); - return -ETIME; + n = -ETIME; + goto exit; } dpnt = inw(dev->iobase + DAS1800_FIFO); /* shift data to offset binary for bipolar ranges */ @@ -1645,6 +1646,7 @@ static int das1800_ai_rinsn(struct comedi_device *dev, dpnt += 1 << (thisboard->resolution - 1); data[n] = dpnt; } +exit: spin_unlock_irqrestore(&dev->spinlock, irq_flags); return n;