From: Marek Szyprowski <m.szyprowski@samsung.com>
To: haibo.chen@nxp.com, adrian.hunter@intel.com,
ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
jh80.chung@samsung.com, kgene@kernel.org, krzk@kernel.org,
michal.simek@xilinx.com, linux-samsung-soc@vger.kernel.org
Cc: linux-imx@nxp.com
Subject: Re: [PATCH] mmc: host: dereference null return value
Date: Wed, 1 Jul 2020 12:57:26 +0200 [thread overview]
Message-ID: <78c6f493-eb0f-d451-22db-aa1836b33018@samsung.com> (raw)
In-Reply-To: <1592885209-25839-1-git-send-email-haibo.chen@nxp.com>
Hi,
On 23.06.2020 06:06, haibo.chen@nxp.com wrote:
> From: Haibo Chen <haibo.chen@nxp.com>
>
> of_match_node() has the opportunity to return NULL, so need to
> dereference null return value.
> This is reported by Coverity.
>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
There is no point in such check for a NULL. The driver won't be
instantiated/probed if there is no matching node found first by the
upper level framework. If you really want to make this code cleaner,
please change it to use of_device_get_match_data().
> ---
> drivers/mmc/host/dw_mmc-exynos.c | 5 +++--
> drivers/mmc/host/dw_mmc-k3.c | 5 +++--
> drivers/mmc/host/dw_mmc-pltfm.c | 3 ++-
> drivers/mmc/host/sdhci-of-arasan.c | 2 ++
> 4 files changed, 10 insertions(+), 5 deletions(-)
> ...
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
prev parent reply other threads:[~2020-07-01 10:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200623041836eucas1p2792e1fe062f8dd59af0ec18b8af1c1ef@eucas1p2.samsung.com>
2020-06-23 4:06 ` [PATCH] mmc: host: dereference null return value haibo.chen
2020-07-01 10:33 ` Adrian Hunter
2020-07-01 10:57 ` Marek Szyprowski [this message]
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=78c6f493-eb0f-d451-22db-aa1836b33018@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=adrian.hunter@intel.com \
--cc=haibo.chen@nxp.com \
--cc=jh80.chung@samsung.com \
--cc=kgene@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=ulf.hansson@linaro.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;
as well as URLs for NNTP newsgroup(s).