aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/diag.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/netlink/diag.c')
-rw-r--r--net/netlink/diag.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netlink/diag.c b/net/netlink/diag.c
index 7301850eb56f..de8c74a3c061 100644
--- a/net/netlink/diag.c
+++ b/net/netlink/diag.c
@@ -170,6 +170,7 @@ static int netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
170 170
171 req = nlmsg_data(cb->nlh); 171 req = nlmsg_data(cb->nlh);
172 172
173 mutex_lock(&nl_sk_hash_lock);
173 read_lock(&nl_table_lock); 174 read_lock(&nl_table_lock);
174 175
175 if (req->sdiag_protocol == NDIAG_PROTO_ALL) { 176 if (req->sdiag_protocol == NDIAG_PROTO_ALL) {
@@ -183,6 +184,7 @@ static int netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
183 } else { 184 } else {
184 if (req->sdiag_protocol >= MAX_LINKS) { 185 if (req->sdiag_protocol >= MAX_LINKS) {
185 read_unlock(&nl_table_lock); 186 read_unlock(&nl_table_lock);
187 mutex_unlock(&nl_sk_hash_lock);
186 return -ENOENT; 188 return -ENOENT;
187 } 189 }
188 190
@@ -190,6 +192,7 @@ static int netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
190 } 192 }
191 193
192 read_unlock(&nl_table_lock); 194 read_unlock(&nl_table_lock);
195 mutex_unlock(&nl_sk_hash_lock);
193 196
194 return skb->len; 197 return skb->len;
195} 198}