Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Christophe JAILLET
	<christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
Cc: thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] memory: tegra: Fix an error handling path in 'tegra186_emc_probe()'
Date: Fri, 8 May 2020 11:49:41 +0300	[thread overview]
Message-ID: <20200508084941.GE9365@kadam> (raw)
In-Reply-To: <20200506200907.195502-1-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>

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

  parent reply	other threads:[~2020-05-08  8:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 20:09 [PATCH] memory: tegra: Fix an error handling path in 'tegra186_emc_probe()' Christophe JAILLET
     [not found] ` <20200506200907.195502-1-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
2020-05-07 19:27   ` Thierry Reding
2020-05-08  8:49   ` Dan Carpenter [this message]
2020-05-08  9:31     ` Marion & Christophe JAILLET

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200508084941.GE9365@kadam \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org \
    --cc=jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox