Skip to contentSkip to conversation

spi: release lock on error path in spi_pump_messages()

PATCH Applied Dan Carpenter 3 participants 5 messages Mar 10, 2012 – Mar 11, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: release lock on error path in spi_pump_messages()

We should release the lock here and enable IRQs before returning.

drivers/spi/spi.c +1 -0
index 5ae1e84..ab1bdce 100644
@@ -535,6 +535,7 @@ static void spi_pump_messages(struct kthread_work *work)
 			if (ret) {
 				dev_err(&master->dev,
 					"failed to unprepare transfer hardware\n");
+				spin_unlock_irqrestore(&master->queue_lock, flags);
 				return;
 			}
 		}
#1 lore raw

Am 10.03.2012 09:57, schrieb Dan Carpenter:

Quoted 9 lines

We should release the lock here and enable IRQs before returning.

drivers/spi/spi.c +0 -0
index 5ae1e84..ab1bdce 100644

drivers/spi/spi.c static void spi_pump_messages(struct kthread_work *work) · line 541

Quoted 7 lines
drivers/spi/spi.c +1 -0
@@ -535,6 +535,7 @@ static void spi_pump_messages(struct kthread_work *work)
 			if (ret) {
 				dev_err(&master->dev,
 					"failed to unprepare transfer hardware\n");
+				spin_unlock_irqrestore(&master->queue_lock, flags);
 				return;
 			}
 		}

hi Dan,
do you want to protect dev_err() by a spn_lock ?

re,
wh

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#2 lore raw
Quoted 7 lines · walter harms

Am 10.03.2012 09:57, schrieb Dan Carpenter:

Quoted 4 lines

We should release the lock here and enable IRQs before returning.

Quoted 16 lines

drivers/spi/spi.c static void spi_pump_messages(struct kthread_work *work) · line 541

Quoted 12 lines
drivers/spi/spi.c +1 -0
index 5ae1e84..ab1bdce 100644
@@ -535,6 +535,7 @@ static void spi_pump_messages(struct kthread_work *work)
 			if (ret) {
 				dev_err(&master->dev,
 					"failed to unprepare transfer hardware\n");
+				spin_unlock_irqrestore(&master->queue_lock, flags);
 				return;
 			}
 		}

hi Dan,
do you want to protect dev_err() by a spn_lock ?

Applied, after moving unlock above the dev_err.

g.

#3 lore raw
Quoted 6 lines · Grant Likely
Quoted 2 lines · walter harms

hi Dan,
do you want to protect dev_err() by a spn_lock ?

Applied, after moving unlock above the dev_err.

Thanks.

I was going to resend this with Walter's change btw. I wasn't going to ignore his review comments.

Anyway, thanks again Grant and Walter.

regards,
dan carpenter

#4 lore raw
Quoted 5 lines · Dan Carpenter
Quoted 4 lines · Grant Likely
Quoted 2 lines · walter harms

hi Dan,
do you want to protect dev_err() by a spn_lock ?

Quoted 7 lines
Quoted 2 lines

Applied, after moving unlock above the dev_err.

Thanks.

I was going to resend this with Walter's change btw. I wasn't going to ignore his review comments.

I assumed you would. It was just simpler for me to pick it up with the trivial change.

g.