[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b4b55c4b-1aff-6272-b15c-67466ee1706e@wanadoo.fr>
Date: Fri, 8 May 2020 11:31:18 +0200
From: Marion & Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: thierry.reding@...il.com, jonathanh@...dia.com,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] memory: tegra: Fix an error handling path in
'tegra186_emc_probe()'
Le 08/05/2020 à 10:49, Dan Carpenter a écrit :
> On Wed, May 06, 2020 at 10:09:07PM +0200, Christophe JAILLET wrote:
>> @@ -237,7 +239,7 @@ static int tegra186_emc_probe(struct platform_device *pdev)
>> "failed to set rate range [%lu-%lu] for %pC\n",
>> emc->debugfs.min_rate, emc->debugfs.max_rate,
>> emc->clk);
>> - return err;
>> + goto err_put_bpmp;
>> }
>>
>> emc->debugfs.root = debugfs_create_dir("emc", NULL);
> Not really related to this patch but the error handling on this
> debugfs_create_dir() call is wrong. It never returns NULL. The error
> should just be ignored. It shouldn't try print a message when debugfs
> is deliberately disabled.
>
> As in the correct code looks like:
>
>
> emc->debugfs.root = debugfs_create_dir("emc", NULL);
> - if (!emc->debugfs.root) {
> - dev_err(&pdev->dev, "failed to create debugfs directory\n");
> - return 0;
> - }
> -
> debugfs_create_file("available_rates", S_IRUGO, emc->debugfs.root,
> emc, &tegra186_emc_debug_available_rates_fops);
> debugfs_create_file("min_rate", S_IRUGO | S_IWUSR, emc->debugfs.root,
>
> debugfs_create_file() will return an error pointer if debugfs_create_dir()
> fails or if debugfs is disabled. (It is a no-op).
>
> regards,
> dan carpenter
LGTM.
I let you propose a patch for it,.
CJ
Powered by blists - more mailing lists