Merge tag 'fbdev-for-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[linux-block.git] / net / smc / smc_cdc.c
index 89105e95b4523f0a0d197e7167f27914430f482e..3c06625ceb200e359c1b4e0d04e4705e0fca51d8 100644 (file)
@@ -28,13 +28,15 @@ static void smc_cdc_tx_handler(struct smc_wr_tx_pend_priv *pnd_snd,
 {
        struct smc_cdc_tx_pend *cdcpend = (struct smc_cdc_tx_pend *)pnd_snd;
        struct smc_connection *conn = cdcpend->conn;
+       struct smc_buf_desc *sndbuf_desc;
        struct smc_sock *smc;
        int diff;
 
+       sndbuf_desc = conn->sndbuf_desc;
        smc = container_of(conn, struct smc_sock, conn);
        bh_lock_sock(&smc->sk);
-       if (!wc_status) {
-               diff = smc_curs_diff(cdcpend->conn->sndbuf_desc->len,
+       if (!wc_status && sndbuf_desc) {
+               diff = smc_curs_diff(sndbuf_desc->len,
                                     &cdcpend->conn->tx_curs_fin,
                                     &cdcpend->cursor);
                /* sndbuf_space is decreased in smc_sendmsg */
@@ -114,9 +116,6 @@ int smc_cdc_msg_send(struct smc_connection *conn,
        union smc_host_cursor cfed;
        int rc;
 
-       if (unlikely(!READ_ONCE(conn->sndbuf_desc)))
-               return -ENOBUFS;
-
        smc_cdc_add_pending_send(conn, pend);
 
        conn->tx_cdc_seq++;
@@ -385,7 +384,7 @@ static void smc_cdc_msg_recv_action(struct smc_sock *smc,
                smc->sk.sk_shutdown |= RCV_SHUTDOWN;
                if (smc->clcsock && smc->clcsock->sk)
                        smc->clcsock->sk->sk_shutdown |= RCV_SHUTDOWN;
-               sock_set_flag(&smc->sk, SOCK_DONE);
+               smc_sock_set_flag(&smc->sk, SOCK_DONE);
                sock_hold(&smc->sk); /* sock_put in close_work */
                if (!queue_work(smc_close_wq, &conn->close_work))
                        sock_put(&smc->sk);