Skip to content

Commit 1b46065

Browse files
Laurent GeorgetJiri Kosina
authored andcommitted
securityfs: fix securityfs_create_dir comment
If there is an error creating a directory with securityfs_create_dir, the error is propagated via ERR_PTR but the function comment claims that NULL is returned. This is a similar commit to 88e6c94 ("fix long-broken securityfs_create_file comment") that did not fix securityfs_create_dir comment at the same time. Signed-off-by: Laurent Georget <laurent.georget@supelec.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 3da7ffe commit 1b46065

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎security/inode.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,11 @@ EXPORT_SYMBOL_GPL(securityfs_create_file);
156156
* This function returns a pointer to a dentry if it succeeds. This
157157
* pointer must be passed to the securityfs_remove() function when the file is
158158
* to be removed (no automatic cleanup happens if your module is unloaded,
159-
* you are responsible here). If an error occurs, %NULL will be returned.
159+
* you are responsible here). If an error occurs, the function will return
160+
* the error value (via ERR_PTR).
160161
*
161162
* If securityfs is not enabled in the kernel, the value %-ENODEV is
162-
* returned. It is not wise to check for this value, but rather, check for
163-
* %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
164-
* code.
163+
* returned.
165164
*/
166165
struct dentry *securityfs_create_dir(const char *name, struct dentry *parent)
167166
{

0 commit comments

Comments
 (0)