if (tmpde) kfree(tmpde); 
kfree(tmpde); 
static void isofs_read_inode(struct inode *inode){	struct super_block *sb = inode->i_sb;	struct isofs_sb_info *sbi = ISOFS_SB(sb);	unsigned long bufsize = ISOFS_BUFFER_SIZE(inode);	unsigned long block;	int high_sierra = sbi->s_high_sierra;	struct buffer_head * bh = NULL;	struct iso_directory_record * de;	struct iso_directory_record * tmpde = NULL;	unsigned int de_len;	unsigned long offset;	struct iso_inode_info *ei = ISOFS_I(inode);	block = ei->i_iget5_block;	bh = sb_bread(inode->i_sb, block);	if (!bh)		goto out_badread;	offset = ei->i_iget5_offset;	de = (struct iso_directory_record *) (bh->b_data + offset);	de_len = *(unsigned char *) de;	if (offset + de_len > bufsize) {		int frag1 = bufsize - offset;		tmpde = kmalloc(de_len, GFP_KERNEL);		if (tmpde == NULL) {			printk(KERN_INFO "isofs_read_inode: out of memory\n");			goto fail;		}		memcpy(tmpde, bh->b_data + offset, frag1);		brelse(bh);		bh = sb_bread(inode->i_sb, ++block);		if (!bh)			goto out_badread;		memcpy((char *)tmpde+frag1, bh->b_data, de_len - frag1);		de = tmpde;	}	inode->i_ino = isofs_get_ino(ei->i_iget5_block,				     ei->i_iget5_offset,				     ISOFS_BUFFER_BITS(inode));	/* Assume it is a normal-format file unless told otherwise */	ei->i_file_format = isofs_file_normal;	if (de->flags[-high_sierra] & 2) {		inode->i_mode = S_IRUGO | S_IXUGO | S_IFDIR;		inode->i_nlink = 1; /* Set to 1.  We know there are 2, but				       the find utility tries to optimize				       if it is 2, and it screws up.  It is				       easier to give 1 which tells find to				       do it the hard way. */	} else { 		/* Everybody gets to read the file. */		inode->i_mode = sbi->s_mode;		inode->i_nlink = 1;	        inode->i_mode |= S_IFREG;	}	inode->i_uid = sbi->s_uid;	inode->i_gid = sbi->s_gid;	inode->i_blocks = inode->i_blksize = 0;	ei->i_format_parm[0] = 0;	ei->i_format_parm[1] = 0;	ei->i_format_parm[2] = 0;	ei->i_section_size = isonum_733 (de->size);	if (de->flags[-high_sierra] & 0x80) {		if(isofs_read_level3_size(inode)) goto fail;	} else {		ei->i_next_section_block = 0;		ei->i_next_section_offset = 0;		inode->i_size = isonum_733 (de->size);	}	/*	 * Some dipshit decided to store some other bit of information	 * in the high byte of the file length.  Truncate size in case	 * this CDROM was mounted with the cruft option.	 */	if (sbi->s_cruft == 'y')		inode->i_size &= 0x00ffffff;	if (de->interleave[0]) {		printk("Interleaved files not (yet) supported.\n");		inode->i_size = 0;	}	/* I have no idea what file_unit_size is used for, so	   we will flag it for now */	if (de->file_unit_size[0] != 0) {		printk("File unit size != 0 for ISO file (%ld).\n",		       inode->i_ino);	}	/* I have no idea what other flag bits are used for, so	   we will flag it for now */#ifdef DEBUG	if((de->flags[-high_sierra] & ~2)!= 0){		printk("Unusual flag settings for ISO file (%ld %x).\n",		       inode->i_ino, de->flags[-high_sierra]);	}#endif	inode->i_mtime.tv_sec =	inode->i_atime.tv_sec =	inode->i_ctime.tv_sec = iso_date(de->date, high_sierra);	inode->i_mtime.tv_nsec =	inode->i_atime.tv_nsec =	inode->i_ctime.tv_nsec = 0;	ei->i_first_extent = (isonum_733 (de->extent) +			      isonum_711 (de->ext_attr_length));	/* Set the number of blocks for stat() - should be done before RR */	inode->i_blksize = PAGE_CACHE_SIZE; /* For stat() only */	inode->i_blocks  = (inode->i_size + 511) >> 9;	/*	 * Now test for possible Rock Ridge extensions which will override	 * some of these numbers in the inode structure.	 */	if (!high_sierra) {		parse_rock_ridge_inode(de, inode);		/* if we want uid/gid set, override the rock ridge setting */		test_and_set_uid(&inode->i_uid, sbi->s_uid);		test_and_set_gid(&inode->i_gid, sbi->s_gid);	}	/* Install the inode operations vector */	if (S_ISREG(inode->i_mode)) {		inode->i_fop = &generic_ro_fops;		switch ( ei->i_file_format ) {#ifdef CONFIG_ZISOFS		case isofs_file_compressed:			inode->i_data.a_ops = &zisofs_aops;			break;#endif		default:			inode->i_data.a_ops = &isofs_aops;			break;		}	} else if (S_ISDIR(inode->i_mode)) {		inode->i_op = &isofs_dir_inode_operations;		inode->i_fop = &isofs_dir_operations;	} else if (S_ISLNK(inode->i_mode)) {		inode->i_op = &page_symlink_inode_operations;		inode->i_data.a_ops = &isofs_symlink_aops;	} else		/* XXX - parse_rock_ridge_inode() had already set i_rdev. */		init_special_inode(inode, inode->i_mode, inode->i_rdev);out:	if (tmpde)		kfree(tmpde);	if (bh)		brelse(bh);	return;out_badread:	printk(KERN_WARNING "ISOFS: unable to read i-node block\n");fail:	make_bad_inode(inode);	goto out;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/f99d49adf527fa6f7a9c42257fa76bca6b8df1e3/inode.c/buggy/fs/isofs/inode.c