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

HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port()

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
c2acb7c4 0a0ea07d

+4 -4
+4 -4
drivers/hsi/controllers/omap_ssi_port.c
··· 177 177 struct hsi_port *port = to_hsi_port(omap_port->dev); 178 178 179 179 dir = debugfs_create_dir(dev_name(omap_port->dev), dir); 180 - if (IS_ERR(dir)) 181 - return PTR_ERR(dir); 180 + if (!dir) 181 + return -ENOMEM; 182 182 omap_port->dir = dir; 183 183 debugfs_create_file("regs", S_IRUGO, dir, port, &ssi_port_regs_fops); 184 184 dir = debugfs_create_dir("sst", dir); 185 - if (IS_ERR(dir)) 186 - return PTR_ERR(dir); 185 + if (!dir) 186 + return -ENOMEM; 187 187 debugfs_create_file("divisor", S_IRUGO | S_IWUSR, dir, port, 188 188 &ssi_sst_div_fops); 189 189