]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
EDAC/synopsys: Return the correct value in mc_probe()
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Mon, 16 Nov 2020 13:58:10 +0000 (08:58 -0500)
committerBorislav Petkov <bp@suse.de>
Wed, 18 Nov 2020 17:59:47 +0000 (18:59 +0100)
Return the error value if the inject sysfs file creation fails, rather
than returning 0, to signal to the upper layer that the ->probe function
failed.

 [ bp: Massage. ]

Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lkml.kernel.org/r/20201116135810.3130845-1-zhangxiaoxu5@huawei.com
drivers/edac/synopsys_edac.c

index 12211dc040e8f1050e59b61c420e2bff03b4a0be..7e7146b22c160739b75ef70a8f9811254d980200 100644 (file)
@@ -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;