All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] debugfs: use IS_ERR to check for error
@ 2021-09-02 10:29 Nirmoy Das
  2021-09-02 10:31 ` Christian König
  2021-09-02 10:38 ` Greg KH
  0 siblings, 2 replies; 12+ messages in thread
From: Nirmoy Das @ 2021-09-02 10:29 UTC (permalink / raw)
  To: rafael; +Cc: linux-kernel, gregkh, Christian.Koenig, Nirmoy Das

debugfs_create_file() returns encoded error so
use IS_ERR for checking return value.

References: https://gitlab.freedesktop.org/drm/amd/-/issues/1686
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
---
 fs/debugfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 8129a430d789..2f117c57160d 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -528,7 +528,7 @@ void debugfs_create_file_size(const char *name, umode_t mode,
 {
 	struct dentry *de = debugfs_create_file(name, mode, parent, data, fops);
 
-	if (de)
+	if (!IS_ERR(de))
 		d_inode(de)->i_size = file_size;
 }
 EXPORT_SYMBOL_GPL(debugfs_create_file_size);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-09-21  7:03 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 10:29 [PATCH 1/1] debugfs: use IS_ERR to check for error Nirmoy Das
2021-09-02 10:31 ` Christian König
2021-09-02 10:38 ` Greg KH
2021-09-02 12:03   ` Christian König
2021-09-02 12:20     ` Greg KH
2021-09-02 15:10       ` Christian König
2021-09-02 16:34         ` Greg KH
2021-09-02 16:44           ` Das, Nirmoy
2021-09-02 16:48           ` Das, Nirmoy
2021-09-02 17:01           ` Das, Nirmoy
2021-09-03  6:27             ` Christian König
2021-09-21  7:03               ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.