Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753089AbdHQP1R (ORCPT ); Thu, 17 Aug 2017 11:27:17 -0400 Received: from mga01.intel.com ([192.55.52.88]:9044 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752484AbdHQP1Q (ORCPT ); Thu, 17 Aug 2017 11:27:16 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,388,1498546800"; d="scan'208";a="301438494" Reply-To: thor.thayer@linux.intel.com Subject: Re: [PATCH] EDAC, altera: Fix an error handling path in 'altr_edac_device_probe()' To: Christophe JAILLET , bp@alien8.de, mchehab@kernel.org Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20170816050506.14541-1-christophe.jaillet@wanadoo.fr> From: Thor Thayer Message-ID: Date: Thu, 17 Aug 2017 10:30:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170816050506.14541-1-christophe.jaillet@wanadoo.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1044 Lines: 31 On 08/16/2017 12:05 AM, Christophe JAILLET wrote: > 'res' is known to be 0 at this point. > If 'devm_ioremap()' fails, returns -ENOMEM instead of 0 which means > success. > > Signed-off-by: Christophe JAILLET > --- > drivers/edac/altera_edac.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c > index fa2e5db56d24..346c4987b284 100644 > --- a/drivers/edac/altera_edac.c > +++ b/drivers/edac/altera_edac.c > @@ -747,8 +747,10 @@ static int altr_edac_device_probe(struct platform_device *pdev) > drvdata->edac_dev_name = ecc_name; > > drvdata->base = devm_ioremap(&pdev->dev, r->start, resource_size(r)); > - if (!drvdata->base) > + if (!drvdata->base) { > + res = -ENOMEM; > goto fail1; > + } > > /* Get driver specific data for this EDAC device */ > drvdata->data = of_match_node(altr_edac_device_of_match, np)->data; > Thank you for this patch! Acked-by: Thor Thayer