* [PATCH] EDAC/synopsys: Fix wrong return value of mc_probe()
@ 2020-11-16 13:58 Zhang Xiaoxu
2020-11-18 13:57 ` Michal Simek
2020-11-18 18:36 ` Borislav Petkov
0 siblings, 2 replies; 3+ messages in thread
From: Zhang Xiaoxu @ 2020-11-16 13:58 UTC (permalink / raw)
To: zhangxiaoxu5, michal.simek, bp, mchehab, tony.luck, james.morse,
rric, linux-arm-kernel, linux-edac
If create the inject sysfs file failed, we should return
the error, rather than 0. Otherwise, there maybe error
pointer access.
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
---
drivers/edac/synopsys_edac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c
index 12211dc040e8..7e7146b22c16 100644
--- a/drivers/edac/synopsys_edac.c
+++ b/drivers/edac/synopsys_edac.c
@@ -1344,7 +1344,8 @@ static int mc_probe(struct platform_device *pdev)
#ifdef CONFIG_EDAC_DEBUG
if (priv->p_data->quirks & DDR_ECC_DATA_POISON_SUPPORT) {
- if (edac_create_sysfs_attributes(mci)) {
+ rc = edac_create_sysfs_attributes(mci);
+ if (rc) {
edac_printk(KERN_ERR, EDAC_MC,
"Failed to create sysfs entries\n");
goto free_edac_mc;
--
2.25.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] EDAC/synopsys: Fix wrong return value of mc_probe()
2020-11-16 13:58 [PATCH] EDAC/synopsys: Fix wrong return value of mc_probe() Zhang Xiaoxu
@ 2020-11-18 13:57 ` Michal Simek
2020-11-18 18:36 ` Borislav Petkov
1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2020-11-18 13:57 UTC (permalink / raw)
To: Zhang Xiaoxu, michal.simek, bp, mchehab, tony.luck, james.morse,
rric, linux-arm-kernel, linux-edac
On 16. 11. 20 14:58, Zhang Xiaoxu wrote:
> If create the inject sysfs file failed, we should return
> the error, rather than 0. Otherwise, there maybe error
> pointer access.
>
> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
> ---
> drivers/edac/synopsys_edac.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c
> index 12211dc040e8..7e7146b22c16 100644
> --- a/drivers/edac/synopsys_edac.c
> +++ b/drivers/edac/synopsys_edac.c
> @@ -1344,7 +1344,8 @@ static int mc_probe(struct platform_device *pdev)
>
> #ifdef CONFIG_EDAC_DEBUG
> if (priv->p_data->quirks & DDR_ECC_DATA_POISON_SUPPORT) {
> - if (edac_create_sysfs_attributes(mci)) {
> + rc = edac_create_sysfs_attributes(mci);
> + if (rc) {
> edac_printk(KERN_ERR, EDAC_MC,
> "Failed to create sysfs entries\n");
> goto free_edac_mc;
>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Thanks,
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] EDAC/synopsys: Fix wrong return value of mc_probe()
2020-11-16 13:58 [PATCH] EDAC/synopsys: Fix wrong return value of mc_probe() Zhang Xiaoxu
2020-11-18 13:57 ` Michal Simek
@ 2020-11-18 18:36 ` Borislav Petkov
1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2020-11-18 18:36 UTC (permalink / raw)
To: Zhang Xiaoxu
Cc: michal.simek, mchehab, tony.luck, james.morse, rric,
linux-arm-kernel, linux-edac
On Mon, Nov 16, 2020 at 08:58:10AM -0500, Zhang Xiaoxu wrote:
> If create the inject sysfs file failed, we should return
> the error, rather than 0. Otherwise, there maybe error
> pointer access.
>
> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
> ---
> drivers/edac/synopsys_edac.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c
> index 12211dc040e8..7e7146b22c16 100644
> --- a/drivers/edac/synopsys_edac.c
> +++ b/drivers/edac/synopsys_edac.c
> @@ -1344,7 +1344,8 @@ static int mc_probe(struct platform_device *pdev)
>
> #ifdef CONFIG_EDAC_DEBUG
> if (priv->p_data->quirks & DDR_ECC_DATA_POISON_SUPPORT) {
> - if (edac_create_sysfs_attributes(mci)) {
> + rc = edac_create_sysfs_attributes(mci);
> + if (rc) {
> edac_printk(KERN_ERR, EDAC_MC,
> "Failed to create sysfs entries\n");
> goto free_edac_mc;
> --
Applied, thanks.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-18 18:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 13:58 [PATCH] EDAC/synopsys: Fix wrong return value of mc_probe() Zhang Xiaoxu
2020-11-18 13:57 ` Michal Simek
2020-11-18 18:36 ` Borislav Petkov
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).