Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1315753 > unrolled thread

[PATCH] hotplug: unlock in error path in acpiphp_enable_slot

Started byInsu Yun <wuninsu@gmail.com>
First post2016-01-23 21:50 +0100
Last post2016-01-24 02:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] hotplug: unlock in error path in acpiphp_enable_slot Insu Yun <wuninsu@gmail.com> - 2016-01-23 21:50 +0100
    Re: [PATCH] hotplug: unlock in error path in acpiphp_enable_slot "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-01-24 02:20 +0100

#1315753 — [PATCH] hotplug: unlock in error path in acpiphp_enable_slot

FromInsu Yun <wuninsu@gmail.com>
Date2016-01-23 21:50 +0100
Subject[PATCH] hotplug: unlock in error path in acpiphp_enable_slot
Message-ID<qUdi9-8oq-3@gated-at.bofh.it>
In acpiphp_enable_slot, there is a missing unlock path
when error occurred. It needs to be unlocked before returning an error.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 drivers/pci/hotplug/acpiphp_glue.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index ff53856..0b3e0bf 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -953,8 +953,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
 {
 	pci_lock_rescan_remove();
 
-	if (slot->flags & SLOT_IS_GOING_AWAY)
+	if (slot->flags & SLOT_IS_GOING_AWAY) {
+		pci_unlock_rescan_remove();
 		return -ENODEV;
+	}
 
 	/* configure all functions */
 	if (!(slot->flags & SLOT_ENABLED))
-- 
1.9.1

[toc] | [next] | [standalone]


#1315800

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2016-01-24 02:20 +0100
Message-ID<qUhvs-5HJ-5@gated-at.bofh.it>
In reply to#1315753
On Saturday, January 23, 2016 03:44:19 PM Insu Yun wrote:
> In acpiphp_enable_slot, there is a missing unlock path
> when error occurred. It needs to be unlocked before returning an error.
> 
> Signed-off-by: Insu Yun <wuninsu@gmail.com>

Applied, thanks!

> ---
>  drivers/pci/hotplug/acpiphp_glue.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index ff53856..0b3e0bf 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -953,8 +953,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
>  {
>  	pci_lock_rescan_remove();
>  
> -	if (slot->flags & SLOT_IS_GOING_AWAY)
> +	if (slot->flags & SLOT_IS_GOING_AWAY) {
> +		pci_unlock_rescan_remove();
>  		return -ENODEV;
> +	}
>  
>  	/* configure all functions */
>  	if (!(slot->flags & SLOT_ENABLED))
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web