Skip to content

Commit e96e8a1

Browse files
elfringjankara
authored andcommitted
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: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 8898662 commit e96e8a1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎fs/isofs/inode.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int __init init_inodecache(void)
9696
0, (SLAB_RECLAIM_ACCOUNT|
9797
SLAB_MEM_SPREAD|SLAB_ACCOUNT),
9898
init_once);
99-
if (isofs_inode_cachep == NULL)
99+
if (!isofs_inode_cachep)
100100
return -ENOMEM;
101101
return 0;
102102
}
@@ -678,7 +678,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
678678
if (isonum_711(vdp->type) == ISO_VD_END)
679679
break;
680680
if (isonum_711(vdp->type) == ISO_VD_PRIMARY) {
681-
if (pri == NULL) {
681+
if (!pri) {
682682
pri = (struct iso_primary_descriptor *)vdp;
683683
/* Save the buffer in case we need it ... */
684684
pri_bh = bh;
@@ -742,7 +742,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
742742
goto out_freebh;
743743
}
744744

745-
if (joliet_level && (pri == NULL || !opt.rock)) {
745+
if (joliet_level && (!pri || !opt.rock)) {
746746
/* This is the case of Joliet with the norock mount flag.
747747
* A disc with both Joliet and Rock Ridge is handled later
748748
*/
@@ -1320,7 +1320,7 @@ static int isofs_read_inode(struct inode *inode, int relocated)
13201320
int frag1 = bufsize - offset;
13211321

13221322
tmpde = kmalloc(de_len, GFP_KERNEL);
1323-
if (tmpde == NULL) {
1323+
if (!tmpde) {
13241324
ret = -ENOMEM;
13251325
goto fail;
13261326
}

0 commit comments

Comments
 (0)