aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swapfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r--mm/swapfile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c
index e70d6c6d6fee..f1f5ec783781 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -442,11 +442,12 @@ int swap_type_of(dev_t device)
442 442
443 if (!(swap_info[i].flags & SWP_WRITEOK)) 443 if (!(swap_info[i].flags & SWP_WRITEOK))
444 continue; 444 continue;
445
445 if (!device) { 446 if (!device) {
446 spin_unlock(&swap_lock); 447 spin_unlock(&swap_lock);
447 return i; 448 return i;
448 } 449 }
449 inode = swap_info->swap_file->f_dentry->d_inode; 450 inode = swap_info[i].swap_file->f_dentry->d_inode;
450 if (S_ISBLK(inode->i_mode) && 451 if (S_ISBLK(inode->i_mode) &&
451 device == MKDEV(imajor(inode), iminor(inode))) { 452 device == MKDEV(imajor(inode), iminor(inode))) {
452 spin_unlock(&swap_lock); 453 spin_unlock(&swap_lock);