From: andrew hendry Date: Tue, 14 Sep 2010 13:31:38 +0000 (+0000) Subject: X.25 remove bkl in bind X-Git-Tag: firefly_0821_release~7613^2~3670^2~454 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=90c27297a9bfb8ea11c0e3f73ad90c4c66e8501e;p=firefly-linux-kernel-4.4.55.git X.25 remove bkl in bind Accept updates socket values in 3 lines so wrapped with lock_sock. Signed-off-by: Andrew Hendry Signed-off-by: David S. Miller --- diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index f6a8f175b4f5..bd6fce31a738 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -688,7 +688,6 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) struct sockaddr_x25 *addr = (struct sockaddr_x25 *)uaddr; int len, i, rc = 0; - lock_kernel(); if (!sock_flag(sk, SOCK_ZAPPED) || addr_len != sizeof(struct sockaddr_x25) || addr->sx25_family != AF_X25) { @@ -704,12 +703,13 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) } } + lock_sock(sk); x25_sk(sk)->source_addr = addr->sx25_addr; x25_insert_socket(sk); sock_reset_flag(sk, SOCK_ZAPPED); + release_sock(sk); SOCK_DEBUG(sk, "x25_bind: socket is bound\n"); out: - unlock_kernel(); return rc; }