From: Manish Narani <manish.narani@xilinx.com>
To: <robh+dt@kernel.org>, <mark.rutland@arm.com>,
<michal.simek@xilinx.com>, <bp@alien8.de>, <mchehab@kernel.org>,
<manish.narani@xilinx.com>, <amit.kucheria@linaro.org>,
<sudeep.holla@arm.com>, <leoyang.li@nxp.com>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-edac@vger.kernel.org>
Subject: [PATCH v10 1/6] edac: synopsys: Add error handling for NULL in probe()
Date: Thu, 25 Oct 2018 11:36:56 +0530 [thread overview]
Message-ID: <1540447621-22870-2-git-send-email-manish.narani@xilinx.com> (raw)
In-Reply-To: <1540447621-22870-1-git-send-email-manish.narani@xilinx.com>
The function of_device_get_match_data() can return NULL in case of
error. Add error handling for the same in probe().
Signed-off-by: Manish Narani <manish.narani@xilinx.com>
---
drivers/edac/synopsys_edac.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c
index 1c3795d..0005ef3 100644
--- a/drivers/edac/synopsys_edac.c
+++ b/drivers/edac/synopsys_edac.c
@@ -477,6 +477,9 @@ static int mc_probe(struct platform_device *pdev)
return PTR_ERR(baseaddr);
p_data = of_device_get_match_data(&pdev->dev);
+ if (!p_data)
+ return -ENODEV;
+
if (!p_data->get_ecc_state(baseaddr)) {
edac_printk(KERN_INFO, EDAC_MC, "ECC not enabled\n");
return -ENXIO;
--
2.1.1
next prev parent reply other threads:[~2018-10-25 6:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-25 6:06 [PATCH v10 0/6] EDAC: Enhancements to Synopsys EDAC driver Manish Narani
2018-10-25 6:06 ` Manish Narani [this message]
2018-10-25 6:06 ` [PATCH v10 2/6] dt: bindings: Document ZynqMP DDRC in Synopsys documentation Manish Narani
2018-10-25 6:06 ` [PATCH v10 3/6] edac: synopsys: Add macro defines for ZynqMP DDRC Manish Narani
2018-10-25 6:06 ` [PATCH v10 4/6] edac: synopsys: Add EDAC ECC support " Manish Narani
2018-10-25 6:07 ` [PATCH v10 5/6] arm64: zynqmp: Add DDRC node Manish Narani
2018-11-05 12:56 ` Borislav Petkov
2018-11-05 13:06 ` Michal Simek
2018-11-05 13:20 ` Borislav Petkov
2018-11-05 13:32 ` Michal Simek
2018-11-05 13:42 ` Borislav Petkov
2018-11-05 13:45 ` Michal Simek
2018-11-05 14:51 ` Olof Johansson
2018-11-05 19:47 ` Borislav Petkov
2018-11-05 20:38 ` Olof Johansson
2018-11-05 20:43 ` Borislav Petkov
2018-11-06 6:46 ` Michal Simek
2018-11-06 9:22 ` Borislav Petkov
2018-11-06 11:54 ` Michal Simek
2018-10-25 6:07 ` [PATCH v10 6/6] edac: synopsys: Add Error Injection support for ZynqMP DDRC Manish Narani
2018-11-02 8:38 ` [PATCH v10 0/6] EDAC: Enhancements to Synopsys EDAC driver Manish Narani
2018-11-02 8:58 ` Borislav Petkov
2018-11-06 10:03 ` Borislav Petkov
2018-11-06 10:42 ` Manish Narani
2018-11-06 10:58 ` Borislav Petkov
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=1540447621-22870-2-git-send-email-manish.narani@xilinx.com \
--to=manish.narani@xilinx.com \
--cc=amit.kucheria@linaro.org \
--cc=bp@alien8.de \
--cc=devicetree@vger.kernel.org \
--cc=leoyang.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=michal.simek@xilinx.com \
--cc=robh+dt@kernel.org \
--cc=sudeep.holla@arm.com \
/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).