Skip to content

Commit 431db53

Browse files
committed
Merge branch 'smc-fixes'
Karsten Graul says: ==================== net/smc: fixes 2021-09-20 Please apply the following patches for smc to netdev's net tree. The first patch adds a missing error check, and the second patch fixes a possible leak of a lock in a worker. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 36747c9 + a18cee4 commit 431db53

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

net/smc/smc_clc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ static int smc_clc_prfx_set(struct socket *clcsock,
230230
goto out_rel;
231231
}
232232
/* get address to which the internal TCP socket is bound */
233-
kernel_getsockname(clcsock, (struct sockaddr *)&addrs);
233+
if (kernel_getsockname(clcsock, (struct sockaddr *)&addrs) < 0)
234+
goto out_rel;
234235
/* analyze IP specific data of net_device belonging to TCP socket */
235236
addr6 = (struct sockaddr_in6 *)&addrs;
236237
rcu_read_lock();

net/smc/smc_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,9 @@ static void smc_conn_abort_work(struct work_struct *work)
14741474
abort_work);
14751475
struct smc_sock *smc = container_of(conn, struct smc_sock, conn);
14761476

1477+
lock_sock(&smc->sk);
14771478
smc_conn_kill(conn, true);
1479+
release_sock(&smc->sk);
14781480
sock_put(&smc->sk); /* sock_hold done by schedulers of abort_work */
14791481
}
14801482

0 commit comments

Comments
 (0)