From patchwork Fri Jun 24 19:15:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Georget X-Patchwork-Id: 9198075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 27CC060754 for ; Fri, 24 Jun 2016 19:23:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18115284CB for ; Fri, 24 Jun 2016 19:23:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CA94284CD; Fri, 24 Jun 2016 19:23:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17902284CB for ; Fri, 24 Jun 2016 19:23:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751133AbcFXTXc (ORCPT ); Fri, 24 Jun 2016 15:23:32 -0400 Received: from lgeorget.eu ([178.170.116.192]:58333 "EHLO lgeorget.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbcFXTXc (ORCPT ); Fri, 24 Jun 2016 15:23:32 -0400 X-Greylist: delayed 450 seconds by postgrey-1.27 at vger.kernel.org; Fri, 24 Jun 2016 15:23:31 EDT Received: from localhost (LFbn-1-3729-195.w86-229.abo.wanadoo.fr [86.229.228.195]) by lgeorget.eu (Postfix) with ESMTPSA id 8055C6BFB8; Fri, 24 Jun 2016 21:15:58 +0200 (CEST) From: Laurent Georget To: linux-security-module@vger.kernel.org Cc: Laurent Georget Subject: [PATCH] securityfs: fix securityfs_create_dir comment Date: Fri, 24 Jun 2016 21:15:31 +0200 Message-Id: <20160624191531.7577-1-laurent.georget@supelec.fr> X-Mailer: git-send-email 2.9.0 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 88e6c94cda322ff2b32f72bb8d96f9675cdad8aa ("fix long-broken securityfs_create_file comment") that did not fix securityfs_create_dir comment at the same time. Signed-off-by: Laurent Georget --- My first contribution to the kernel. I hope I formatted and sent my patch correctly. Cheers, Laurent security/inode.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/security/inode.c b/security/inode.c index 16622ae..c22e648 100644 --- a/security/inode.c +++ b/security/inode.c @@ -156,12 +156,11 @@ EXPORT_SYMBOL_GPL(securityfs_create_file); * This function returns a pointer to a dentry if it succeeds. This * pointer must be passed to the securityfs_remove() function when the file is * to be removed (no automatic cleanup happens if your module is unloaded, - * you are responsible here). If an error occurs, %NULL will be returned. + * you are responsible here). If an error occurs, the function will return + * the error value (via ERR_PTR). * * If securityfs is not enabled in the kernel, the value %-ENODEV is - * returned. It is not wise to check for this value, but rather, check for - * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling - * code. + * returned. */ struct dentry *securityfs_create_dir(const char *name, struct dentry *parent) {