Re: [PATCH] EDAC/altera: Fix error checking

From: Borislav Petkov
Date: Wed Jun 07 2023 - 04:53:24 EST


On Thu, May 18, 2023 at 03:15:56AM +0800, Yeqi Fu wrote:
> The function edac_debugfs_create_dir returns ERR_PTR if an error
> occurs, and the appropriate way to verify for errors is to use the
> inline function IS_ERR. The patch will substitute the null-comparison
> with IS_ERR.
>
> Signed-off-by: Yeqi Fu <asuk4.q@xxxxxxxxx>
> ---
> drivers/edac/altera_edac.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
> index 8b31cd54bdb6..19693333408f 100644
> --- a/drivers/edac/altera_edac.c
> +++ b/drivers/edac/altera_edac.c
> @@ -683,7 +683,7 @@ static void altr_create_edacdev_dbgfs(struct edac_device_ctl_info *edac_dci,
> return;
>
> drvdata->debugfs_dir = edac_debugfs_create_dir(drvdata->edac_dev_name);
> - if (!drvdata->debugfs_dir)
> + if (IS_ERR(drvdata->debugfs_dir))
> return;
>
> if (!edac_debugfs_create_file("altr_trigger", S_IWUSR,
> --

Applied, thanks.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette