* [PATCH] HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port()
@ 2014-07-30 0:53 weiyj_lk
2014-07-30 22:31 ` Sebastian Reichel
0 siblings, 1 reply; 2+ messages in thread
From: weiyj_lk @ 2014-07-30 0:53 UTC (permalink / raw)
To: Sebastian Reichel, Grant Likely, Rob Herring, Arnd Bergmann,
Carlos Chinea
Cc: Wei Yongjun, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
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>
---
drivers/hsi/controllers/omap_ssi_port.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c
index 29aea0b..eefbb50 100644
--- a/drivers/hsi/controllers/omap_ssi_port.c
+++ b/drivers/hsi/controllers/omap_ssi_port.c
@@ -177,13 +177,13 @@ static int __init ssi_debug_add_port(struct omap_ssi_port *omap_port,
struct hsi_port *port = to_hsi_port(omap_port->dev);
dir = debugfs_create_dir(dev_name(omap_port->dev), dir);
- if (IS_ERR(dir))
- return PTR_ERR(dir);
+ if (!dir)
+ return -ENOMEM;
omap_port->dir = dir;
debugfs_create_file("regs", S_IRUGO, dir, port, &ssi_port_regs_fops);
dir = debugfs_create_dir("sst", dir);
- if (IS_ERR(dir))
- return PTR_ERR(dir);
+ if (!dir)
+ return -ENOMEM;
debugfs_create_file("divisor", S_IRUGO | S_IWUSR, dir, port,
&ssi_sst_div_fops);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port()
2014-07-30 0:53 [PATCH] HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port() weiyj_lk
@ 2014-07-30 22:31 ` Sebastian Reichel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2014-07-30 22:31 UTC (permalink / raw)
To: weiyj_lk; +Cc: Wei Yongjun, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
Hi,
On Wed, Jul 30, 2014 at 08:53:20AM +0800, weiyj_lk@163.com wrote:
> 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.
thanks, pulled:
https://git.kernel.org/cgit/linux/kernel/git/sre/linux-hsi.git/commit/?h=for-next&id=c2acb7c4d566a1735e255acc7260e1dec6b9a7c8
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-30 22:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-30 0:53 [PATCH] HSI: omap_ssi_port: Fix return value check in ssi_debug_add_port() weiyj_lk
2014-07-30 22:31 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®