diff mbox

[FIX] powerpc/pseries: Release DRC when configure_connector fails

Message ID 1441361052-3319-1-git-send-email-bharata.rao@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Bharata B Rao Sept. 4, 2015, 10:04 a.m. UTC
From: Bharata B Rao <bharata@linux.vnet.ibm.com>

dlpar_cpu_probe() should release the acquired DRC if configure_connector
call fails.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/pseries/dlpar.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Nathan Fontenot Sept. 4, 2015, 2:42 p.m. UTC | #1
On 09/04/2015 05:04 AM, Bharata B Rao wrote:
> From: Bharata B Rao <bharata@linux.vnet.ibm.com>
> 
> dlpar_cpu_probe() should release the acquired DRC if configure_connector
> call fails.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>

Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

> ---
>  arch/powerpc/platforms/pseries/dlpar.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
> index 47d9cebe..db17827 100644
> --- a/arch/powerpc/platforms/pseries/dlpar.c
> +++ b/arch/powerpc/platforms/pseries/dlpar.c
> @@ -422,8 +422,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
> 
>  	dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent);
>  	of_node_put(parent);
> -	if (!dn)
> +	if (!dn) {
> +		dlpar_release_drc(drc_index);
>  		return -EINVAL;
> +	}
> 
>  	rc = dlpar_attach_node(dn);
>  	if (rc) {
>
Michael Ellerman Sept. 7, 2015, 9:22 a.m. UTC | #2
On Fri, 2015-04-09 at 10:04:12 UTC, Bharata B Rao wrote:
> From: Bharata B Rao <bharata@linux.vnet.ibm.com>
> 
> dlpar_cpu_probe() should release the acquired DRC if configure_connector
> call fails.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>

Which commit caused this to be a bug? Or has it always been there?

What is the symptom, is it catastrophic, or just cosmetic?

Should the fix go to stable?

cheers
Bharata B Rao Sept. 7, 2015, 10:24 a.m. UTC | #3
On Mon, Sep 07, 2015 at 07:22:04PM +1000, Michael Ellerman wrote:
> On Fri, 2015-04-09 at 10:04:12 UTC, Bharata B Rao wrote:
> > From: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > 
> > dlpar_cpu_probe() should release the acquired DRC if configure_connector
> > call fails.
> > 
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> > Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> 
> Which commit caused this to be a bug? Or has it always been there?
> 
> What is the symptom, is it catastrophic, or just cosmetic?
> 
> Should the fix go to stable?

Posted v1 with the above questions answered appropriately.

Regards,
Bharata.
diff mbox

Patch

diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 47d9cebe..db17827 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -422,8 +422,10 @@  static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
 
 	dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent);
 	of_node_put(parent);
-	if (!dn)
+	if (!dn) {
+		dlpar_release_drc(drc_index);
 		return -EINVAL;
+	}
 
 	rc = dlpar_attach_node(dn);
 	if (rc) {