Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HSI: omap_ssi: Fix return value check in ssi_debug_add_ctrl()

In case of error, the function debugfs_create_*() returns NULL
pointer not ERR_PTR() if debugfs is enabled. The IS_ERR() test
in the return value check should be replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Sebastian Reichel <sre@kernel.org>

authored by

Wei Yongjun and committed by
Sebastian Reichel
3fd276e9 c2acb7c4

+4 -4
+4 -4
drivers/hsi/controllers/omap_ssi.c
··· 148 148 149 149 /* SSI controller */ 150 150 omap_ssi->dir = debugfs_create_dir(dev_name(&ssi->device), NULL); 151 - if (IS_ERR(omap_ssi->dir)) 152 - return PTR_ERR(omap_ssi->dir); 151 + if (!omap_ssi->dir) 152 + return -ENOMEM; 153 153 154 154 debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi, 155 155 &ssi_regs_fops); 156 156 /* SSI GDD (DMA) */ 157 157 dir = debugfs_create_dir("gdd", omap_ssi->dir); 158 - if (IS_ERR(dir)) 158 + if (!dir) 159 159 goto rback; 160 160 debugfs_create_file("regs", S_IRUGO, dir, ssi, &ssi_gdd_regs_fops); 161 161 ··· 163 163 rback: 164 164 debugfs_remove_recursive(omap_ssi->dir); 165 165 166 - return PTR_ERR(dir); 166 + return -ENOMEM; 167 167 } 168 168 169 169 static void ssi_debug_remove_ctrl(struct hsi_controller *ssi)