diff mbox

ghes: fix error return code in ghes_probe()

Message ID CAPgLHd8ONsRjZr9vKMiSR3ZgD7nD8mg+x3pM88+U6DPB=bO_XQ@mail.gmail.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Wei Yongjun June 3, 2013, 2:08 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code in the acpi_gsi_to_irq() and
request_irq() error handling case instead of 0, as done elsewhere
in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/acpi/apei/ghes.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Huang, Ying June 3, 2013, 2:14 a.m. UTC | #1
On Mon, 2013-06-03 at 10:08 +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code in the acpi_gsi_to_irq() and
> request_irq() error handling case instead of 0, as done elsewhere
> in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Good catch!

Reviewed-by: Huang Ying <ying.huang@intel.com>

Best Regards,
Huang Ying

> ---
>  drivers/acpi/apei/ghes.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index 403baf4..fcd7d91 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -919,13 +919,14 @@ static int ghes_probe(struct platform_device *ghes_dev)
>  		break;
>  	case ACPI_HEST_NOTIFY_EXTERNAL:
>  		/* External interrupt vector is GSI */
> -		if (acpi_gsi_to_irq(generic->notify.vector, &ghes->irq)) {
> +		rc = acpi_gsi_to_irq(generic->notify.vector, &ghes->irq);
> +		if (rc) {
>  			pr_err(GHES_PFX "Failed to map GSI to IRQ for generic hardware error source: %d\n",
>  			       generic->header.source_id);
>  			goto err_edac_unreg;
>  		}
> -		if (request_irq(ghes->irq, ghes_irq_func,
> -				0, "GHES IRQ", ghes)) {
> +		rc = request_irq(ghes->irq, ghes_irq_func, 0, "GHES IRQ", ghes);
> +		if (rc) {
>  			pr_err(GHES_PFX "Failed to register IRQ for generic hardware error source: %d\n",
>  			       generic->header.source_id);
>  			goto err_edac_unreg;
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael Wysocki June 3, 2013, 7:48 p.m. UTC | #2
On Monday, June 03, 2013 10:14:54 AM Huang Ying wrote:
> On Mon, 2013-06-03 at 10:08 +0800, Wei Yongjun wrote:
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> > 
> > Fix to return a negative error code in the acpi_gsi_to_irq() and
> > request_irq() error handling case instead of 0, as done elsewhere
> > in this function.
> > 
> > Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Good catch!
> 
> Reviewed-by: Huang Ying <ying.huang@intel.com>

Queued up as a fix for 3.10.

Do we need that in -stable?  If so, which versions?

Rafael


> > ---
> >  drivers/acpi/apei/ghes.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> > index 403baf4..fcd7d91 100644
> > --- a/drivers/acpi/apei/ghes.c
> > +++ b/drivers/acpi/apei/ghes.c
> > @@ -919,13 +919,14 @@ static int ghes_probe(struct platform_device *ghes_dev)
> >  		break;
> >  	case ACPI_HEST_NOTIFY_EXTERNAL:
> >  		/* External interrupt vector is GSI */
> > -		if (acpi_gsi_to_irq(generic->notify.vector, &ghes->irq)) {
> > +		rc = acpi_gsi_to_irq(generic->notify.vector, &ghes->irq);
> > +		if (rc) {
> >  			pr_err(GHES_PFX "Failed to map GSI to IRQ for generic hardware error source: %d\n",
> >  			       generic->header.source_id);
> >  			goto err_edac_unreg;
> >  		}
> > -		if (request_irq(ghes->irq, ghes_irq_func,
> > -				0, "GHES IRQ", ghes)) {
> > +		rc = request_irq(ghes->irq, ghes_irq_func, 0, "GHES IRQ", ghes);
> > +		if (rc) {
> >  			pr_err(GHES_PFX "Failed to register IRQ for generic hardware error source: %d\n",
> >  			       generic->header.source_id);
> >  			goto err_edac_unreg;
> > 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 403baf4..fcd7d91 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -919,13 +919,14 @@  static int ghes_probe(struct platform_device *ghes_dev)
 		break;
 	case ACPI_HEST_NOTIFY_EXTERNAL:
 		/* External interrupt vector is GSI */
-		if (acpi_gsi_to_irq(generic->notify.vector, &ghes->irq)) {
+		rc = acpi_gsi_to_irq(generic->notify.vector, &ghes->irq);
+		if (rc) {
 			pr_err(GHES_PFX "Failed to map GSI to IRQ for generic hardware error source: %d\n",
 			       generic->header.source_id);
 			goto err_edac_unreg;
 		}
-		if (request_irq(ghes->irq, ghes_irq_func,
-				0, "GHES IRQ", ghes)) {
+		rc = request_irq(ghes->irq, ghes_irq_func, 0, "GHES IRQ", ghes);
+		if (rc) {
 			pr_err(GHES_PFX "Failed to register IRQ for generic hardware error source: %d\n",
 			       generic->header.source_id);
 			goto err_edac_unreg;