mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
spi: spi-rspi: fix inconsistent spin_lock_irqsave
This patch fixes the following Smatch warning:
CHECK drivers/spi/spi-rspi.c
drivers/spi/spi-rspi.c:606 rspi_work() warn: inconsistent returns spin_lock:&rspi->lock: locked (602) unlocked (606)
drivers/spi/spi-rspi.c:606 rspi_work() warn: inconsistent returns irqsave🎏 locked (602) unlocked (606)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
e2b0509908
commit
8d4d08ce83
@ -564,8 +564,12 @@ static void rspi_work(struct work_struct *work)
|
|||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
spin_lock_irqsave(&rspi->lock, flags);
|
while (1) {
|
||||||
while (!list_empty(&rspi->queue)) {
|
spin_lock_irqsave(&rspi->lock, flags);
|
||||||
|
if (list_empty(&rspi->queue)) {
|
||||||
|
spin_unlock_irqrestore(&rspi->lock, flags);
|
||||||
|
break;
|
||||||
|
}
|
||||||
mesg = list_entry(rspi->queue.next, struct spi_message, queue);
|
mesg = list_entry(rspi->queue.next, struct spi_message, queue);
|
||||||
list_del_init(&mesg->queue);
|
list_del_init(&mesg->queue);
|
||||||
spin_unlock_irqrestore(&rspi->lock, flags);
|
spin_unlock_irqrestore(&rspi->lock, flags);
|
||||||
@ -595,8 +599,6 @@ static void rspi_work(struct work_struct *work)
|
|||||||
|
|
||||||
mesg->status = 0;
|
mesg->status = 0;
|
||||||
mesg->complete(mesg->context);
|
mesg->complete(mesg->context);
|
||||||
|
|
||||||
spin_lock_irqsave(&rspi->lock, flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user