diff options
-rw-r--r-- | ipc/util.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/ipc/util.c b/ipc/util.c index 3339177b336c..0f468c34e83c 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
@@ -688,10 +688,6 @@ void ipc64_perm_to_ipc_perm (struct ipc64_perm *in, struct ipc_perm *out) | |||
688 | * Look for an id in the ipc ids idr and lock the associated ipc object. | 688 | * Look for an id in the ipc ids idr and lock the associated ipc object. |
689 | * | 689 | * |
690 | * The ipc object is locked on exit. | 690 | * The ipc object is locked on exit. |
691 | * | ||
692 | * This is the routine that should be called when the rw_mutex is not already | ||
693 | * held, i.e. idr tree not protected: it protects the idr tree in read mode | ||
694 | * during the idr_find(). | ||
695 | */ | 691 | */ |
696 | 692 | ||
697 | struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id) | 693 | struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id) |
@@ -699,18 +695,13 @@ struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id) | |||
699 | struct kern_ipc_perm *out; | 695 | struct kern_ipc_perm *out; |
700 | int lid = ipcid_to_idx(id); | 696 | int lid = ipcid_to_idx(id); |
701 | 697 | ||
702 | down_read(&ids->rw_mutex); | ||
703 | |||
704 | rcu_read_lock(); | 698 | rcu_read_lock(); |
705 | out = idr_find(&ids->ipcs_idr, lid); | 699 | out = idr_find(&ids->ipcs_idr, lid); |
706 | if (out == NULL) { | 700 | if (out == NULL) { |
707 | rcu_read_unlock(); | 701 | rcu_read_unlock(); |
708 | up_read(&ids->rw_mutex); | ||
709 | return ERR_PTR(-EINVAL); | 702 | return ERR_PTR(-EINVAL); |
710 | } | 703 | } |
711 | 704 | ||
712 | up_read(&ids->rw_mutex); | ||
713 | |||
714 | spin_lock(&out->lock); | 705 | spin_lock(&out->lock); |
715 | 706 | ||
716 | /* ipc_rmid() may have already freed the ID while ipc_lock | 707 | /* ipc_rmid() may have already freed the ID while ipc_lock |