Skip to content

Commit

Permalink
orangefs: Adjust three checks for null pointers
Browse files Browse the repository at this point in the history
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written !…

Thus fix affected source code places.

Signed-off-by: Markus Elfring <[email protected]>
Signed-off-by: Mike Marshall <[email protected]>
  • Loading branch information
elfring authored and hubcapsc committed Sep 14, 2017
1 parent 5e273a0 commit 0b08273
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fs/orangefs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct posix_acl *orangefs_get_acl(struct inode *inode, int type)
* I don't do that for now.
*/
value = kmalloc(ORANGEFS_MAX_XATTR_VALUELEN, GFP_KERNEL);
if (value == NULL)
if (!value)
return ERR_PTR(-ENOMEM);

gossip_debug(GOSSIP_ACL_DEBUG,
Expand Down
4 changes: 2 additions & 2 deletions fs/orangefs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ int orangefs_inode_setxattr(struct inode *inode, const char *name,
internal_flag = convert_to_internal_xattr_flags(flags);

/* This is equivalent to a removexattr */
if (size == 0 && value == NULL) {
if (size == 0 && !value) {
gossip_debug(GOSSIP_XATTR_DEBUG,
"removing xattr (%s)\n",
name);
Expand Down Expand Up @@ -311,7 +311,7 @@ ssize_t orangefs_listxattr(struct dentry *dentry, char *buffer, size_t size)
int i = 0;
int returned_count = 0;

if (size > 0 && buffer == NULL) {
if (size > 0 && !buffer) {
gossip_err("%s: bogus NULL pointers\n", __func__);
return -EINVAL;
}
Expand Down

0 comments on commit 0b08273

Please sign in to comment.