All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipmi/powernv: Fix minor locking bug
@ 2015-04-10  7:32 ` Alistair Popple
  0 siblings, 0 replies; 3+ messages in thread
From: Alistair Popple @ 2015-04-10  7:32 UTC (permalink / raw)
  To: openipmi-developer
  Cc: linux-kernel, minyard, jk, linuxppc-dev, Alistair Popple

If ipmi_powernv_recv(...) is called without a current message it
prints a warning and returns. However it fails to release the message
lock causing the system to dead lock during any subsequent IPMI
operations.

This error path should never normally be taken unless there are bugs
elsewhere in the system.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
 drivers/char/ipmi/ipmi_powernv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/ipmi/ipmi_powernv.c b/drivers/char/ipmi/ipmi_powernv.c
index b3a2224..9b409c0 100644
--- a/drivers/char/ipmi/ipmi_powernv.c
+++ b/drivers/char/ipmi/ipmi_powernv.c
@@ -126,6 +126,7 @@ static int ipmi_powernv_recv(struct ipmi_smi_powernv *smi)
 	spin_lock_irqsave(&smi->msg_lock, flags);
 
 	if (!smi->cur_msg) {
+		spin_unlock_irqrestore(&smi->msg_lock, flags);
 		pr_warn("no current message?\n");
 		return 0;
 	}
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] ipmi/powernv: Fix minor locking bug
@ 2015-04-10  7:32 ` Alistair Popple
  0 siblings, 0 replies; 3+ messages in thread
From: Alistair Popple @ 2015-04-10  7:32 UTC (permalink / raw)
  To: openipmi-developer
  Cc: Alistair Popple, linuxppc-dev, linux-kernel, minyard, jk

If ipmi_powernv_recv(...) is called without a current message it
prints a warning and returns. However it fails to release the message
lock causing the system to dead lock during any subsequent IPMI
operations.

This error path should never normally be taken unless there are bugs
elsewhere in the system.

Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
 drivers/char/ipmi/ipmi_powernv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/ipmi/ipmi_powernv.c b/drivers/char/ipmi/ipmi_powernv.c
index b3a2224..9b409c0 100644
--- a/drivers/char/ipmi/ipmi_powernv.c
+++ b/drivers/char/ipmi/ipmi_powernv.c
@@ -126,6 +126,7 @@ static int ipmi_powernv_recv(struct ipmi_smi_powernv *smi)
 	spin_lock_irqsave(&smi->msg_lock, flags);
 
 	if (!smi->cur_msg) {
+		spin_unlock_irqrestore(&smi->msg_lock, flags);
 		pr_warn("no current message?\n");
 		return 0;
 	}
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Openipmi-developer] [PATCH] ipmi/powernv: Fix minor locking bug
  2015-04-10  7:32 ` Alistair Popple
  (?)
@ 2015-04-10 11:47 ` Corey Minyard
  -1 siblings, 0 replies; 3+ messages in thread
From: Corey Minyard @ 2015-04-10 11:47 UTC (permalink / raw)
  To: Alistair Popple, openipmi-developer; +Cc: linuxppc-dev, linux-kernel, jk

I should have caught that one.  Thanks.

-corey

On 04/10/2015 02:32 AM, Alistair Popple wrote:
> If ipmi_powernv_recv(...) is called without a current message it
> prints a warning and returns. However it fails to release the message
> lock causing the system to dead lock during any subsequent IPMI
> operations.
>
> This error path should never normally be taken unless there are bugs
> elsewhere in the system.
>
> Signed-off-by: Alistair Popple <alistair@popple.id.au>
> ---
>  drivers/char/ipmi/ipmi_powernv.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/char/ipmi/ipmi_powernv.c b/drivers/char/ipmi/ipmi_powernv.c
> index b3a2224..9b409c0 100644
> --- a/drivers/char/ipmi/ipmi_powernv.c
> +++ b/drivers/char/ipmi/ipmi_powernv.c
> @@ -126,6 +126,7 @@ static int ipmi_powernv_recv(struct ipmi_smi_powernv *smi)
>  	spin_lock_irqsave(&smi->msg_lock, flags);
>  
>  	if (!smi->cur_msg) {
> +		spin_unlock_irqrestore(&smi->msg_lock, flags);
>  		pr_warn("no current message?\n");
>  		return 0;
>  	}


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-10 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10  7:32 [PATCH] ipmi/powernv: Fix minor locking bug Alistair Popple
2015-04-10  7:32 ` Alistair Popple
2015-04-10 11:47 ` [Openipmi-developer] " Corey Minyard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.