diff options
author | David S. Miller <davem@davemloft.net> | 2017-11-24 01:33:34 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-24 01:33:34 +0900 |
commit | 9477fef4b653808d47243e06fa83b8b8aa36944f (patch) | |
tree | 25c45bf458dbffcd8d7a44be84cda22a258fdd6a /net | |
parent | bbfcd77631573ac4a9f57eb6169e04256a111bc1 (diff) | |
parent | 688703702584dd513b50001bd1eb068655631e9b (diff) |
Merge branch 'smc-fixes-for-smc-buffer-handling'
Ursula Braun says:
====================
net/smc: fixes for smc buffer handling
here are 2 cleanup patches for smc buffer handling.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/smc/smc_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 2578fbd95664..94f21116dac5 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -562,7 +562,7 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_rmb) { struct smc_connection *conn = &smc->conn; struct smc_link_group *lgr = conn->lgr; - struct smc_buf_desc *buf_desc = NULL; + struct smc_buf_desc *buf_desc = ERR_PTR(-ENOMEM); struct list_head *buf_list; int bufsize, bufsize_short; int sk_buf_size; @@ -575,7 +575,7 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_rmb) /* use socket send buffer size (w/o overhead) as start value */ sk_buf_size = smc->sk.sk_sndbuf / 2; - for (bufsize_short = smc_compress_bufsize(smc->sk.sk_sndbuf / 2); + for (bufsize_short = smc_compress_bufsize(sk_buf_size); bufsize_short >= 0; bufsize_short--) { if (is_rmb) { |