Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[sfrench/cifs-2.6.git] / fs / isofs / inode.c
index 2f6239c7073ac91425dd87f81b6008467ff3a7a7..db692f554158854d4fa683d116827594d6ffd978 100644 (file)
@@ -96,7 +96,7 @@ static int __init init_inodecache(void)
                                        0, (SLAB_RECLAIM_ACCOUNT|
                                        SLAB_MEM_SPREAD|SLAB_ACCOUNT),
                                        init_once);
-       if (isofs_inode_cachep == NULL)
+       if (!isofs_inode_cachep)
                return -ENOMEM;
        return 0;
 }
@@ -410,7 +410,11 @@ static int parse_options(char *options, struct iso9660_options *popt)
                        if (match_int(&args[0], &option))
                                return 0;
                        n = option;
-                       if (n > 99)
+                       /*
+                        * Track numbers are supposed to be in range 1-99, the
+                        * mount option starts indexing at 0.
+                        */
+                       if (n >= 99)
                                return 0;
                        popt->session = n + 1;
                        break;
@@ -543,7 +547,7 @@ static unsigned int isofs_get_last_session(struct super_block *sb, s32 session)
 
        vol_desc_start=0;
        ms_info.addr_format=CDROM_LBA;
-       if(session >= 0 && session <= 99) {
+       if (session > 0) {
                struct cdrom_tocentry Te;
                Te.cdte_track=session;
                Te.cdte_format=CDROM_LBA;
@@ -674,7 +678,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
                        if (isonum_711(vdp->type) == ISO_VD_END)
                                break;
                        if (isonum_711(vdp->type) == ISO_VD_PRIMARY) {
-                               if (pri == NULL) {
+                               if (!pri) {
                                        pri = (struct iso_primary_descriptor *)vdp;
                                        /* Save the buffer in case we need it ... */
                                        pri_bh = bh;
@@ -738,7 +742,7 @@ root_found:
                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.
                 * A disc with both Joliet and Rock Ridge is handled later
                 */
@@ -1294,7 +1298,7 @@ static int isofs_read_inode(struct inode *inode, int relocated)
        unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);
        unsigned long block;
        int high_sierra = sbi->s_high_sierra;
-       struct buffer_head *bh = NULL;
+       struct buffer_head *bh;
        struct iso_directory_record *de;
        struct iso_directory_record *tmpde = NULL;
        unsigned int de_len;
@@ -1316,8 +1320,7 @@ static int isofs_read_inode(struct inode *inode, int relocated)
                int frag1 = bufsize - offset;
 
                tmpde = kmalloc(de_len, GFP_KERNEL);
-               if (tmpde == NULL) {
-                       printk(KERN_INFO "%s: out of memory\n", __func__);
+               if (!tmpde) {
                        ret = -ENOMEM;
                        goto fail;
                }