Commit e96e8a1d authored by Markus Elfring's avatar Markus Elfring Committed by Jan Kara

isofs: Adjust four checks for null pointers

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

Comparison to NULL could be written !...

Thus fix the affected source code places.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 88986622
...@@ -96,7 +96,7 @@ static int __init init_inodecache(void) ...@@ -96,7 +96,7 @@ static int __init init_inodecache(void)
0, (SLAB_RECLAIM_ACCOUNT| 0, (SLAB_RECLAIM_ACCOUNT|
SLAB_MEM_SPREAD|SLAB_ACCOUNT), SLAB_MEM_SPREAD|SLAB_ACCOUNT),
init_once); init_once);
if (isofs_inode_cachep == NULL) if (!isofs_inode_cachep)
return -ENOMEM; return -ENOMEM;
return 0; return 0;
} }
...@@ -678,7 +678,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) ...@@ -678,7 +678,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
if (isonum_711(vdp->type) == ISO_VD_END) if (isonum_711(vdp->type) == ISO_VD_END)
break; break;
if (isonum_711(vdp->type) == ISO_VD_PRIMARY) { if (isonum_711(vdp->type) == ISO_VD_PRIMARY) {
if (pri == NULL) { if (!pri) {
pri = (struct iso_primary_descriptor *)vdp; pri = (struct iso_primary_descriptor *)vdp;
/* Save the buffer in case we need it ... */ /* Save the buffer in case we need it ... */
pri_bh = bh; pri_bh = bh;
...@@ -742,7 +742,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) ...@@ -742,7 +742,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
goto out_freebh; goto out_freebh;
} }
if (joliet_level && (pri == NULL || !opt.rock)) { if (joliet_level && (!pri || !opt.rock)) {
/* This is the case of Joliet with the norock mount flag. /* This is the case of Joliet with the norock mount flag.
* A disc with both Joliet and Rock Ridge is handled later * A disc with both Joliet and Rock Ridge is handled later
*/ */
...@@ -1320,7 +1320,7 @@ static int isofs_read_inode(struct inode *inode, int relocated) ...@@ -1320,7 +1320,7 @@ static int isofs_read_inode(struct inode *inode, int relocated)
int frag1 = bufsize - offset; int frag1 = bufsize - offset;
tmpde = kmalloc(de_len, GFP_KERNEL); tmpde = kmalloc(de_len, GFP_KERNEL);
if (tmpde == NULL) { if (!tmpde) {
ret = -ENOMEM; ret = -ENOMEM;
goto fail; goto fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment