Loading fs/coda/inode.c +15 −17 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ static int get_device_index(struct coda_mount_data *data) { struct file *file; struct inode *inode; int idx; int idx, fput_needed; if (data == NULL) { printk("coda_read_super: Bad mount data\n"); Loading @@ -121,22 +121,17 @@ static int get_device_index(struct coda_mount_data *data) return -1; } file = fget(data->fd); inode = NULL; if(file) file = fget_light(data->fd, &fput_needed); if (!file) goto Ebadf; inode = file->f_path.dentry->d_inode; if(!inode || !S_ISCHR(inode->i_mode) || imajor(inode) != CODA_PSDEV_MAJOR) { if(file) fput(file); printk("coda_read_super: Bad file\n"); return -1; if (!S_ISCHR(inode->i_mode) || imajor(inode) != CODA_PSDEV_MAJOR) { fput_light(file, fput_needed); goto Ebadf; } idx = iminor(inode); fput(file); fput_light(file, fput_needed); if (idx < 0 || idx >= MAX_CODADEVS) { printk("coda_read_super: Bad minor number\n"); Loading @@ -144,6 +139,9 @@ static int get_device_index(struct coda_mount_data *data) } return idx; Ebadf: printk("coda_read_super: Bad file\n"); return -1; } static int coda_fill_super(struct super_block *sb, void *data, int silent) Loading Loading
fs/coda/inode.c +15 −17 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ static int get_device_index(struct coda_mount_data *data) { struct file *file; struct inode *inode; int idx; int idx, fput_needed; if (data == NULL) { printk("coda_read_super: Bad mount data\n"); Loading @@ -121,22 +121,17 @@ static int get_device_index(struct coda_mount_data *data) return -1; } file = fget(data->fd); inode = NULL; if(file) file = fget_light(data->fd, &fput_needed); if (!file) goto Ebadf; inode = file->f_path.dentry->d_inode; if(!inode || !S_ISCHR(inode->i_mode) || imajor(inode) != CODA_PSDEV_MAJOR) { if(file) fput(file); printk("coda_read_super: Bad file\n"); return -1; if (!S_ISCHR(inode->i_mode) || imajor(inode) != CODA_PSDEV_MAJOR) { fput_light(file, fput_needed); goto Ebadf; } idx = iminor(inode); fput(file); fput_light(file, fput_needed); if (idx < 0 || idx >= MAX_CODADEVS) { printk("coda_read_super: Bad minor number\n"); Loading @@ -144,6 +139,9 @@ static int get_device_index(struct coda_mount_data *data) } return idx; Ebadf: printk("coda_read_super: Bad file\n"); return -1; } static int coda_fill_super(struct super_block *sb, void *data, int silent) Loading