Skip to content

Commit

Permalink
Merge branch 'net-smc-fixes-2020-10-23'
Browse files Browse the repository at this point in the history
Karsten Graul says:

====================
net/smc: fixes 2020-10-23

Patch 1 fixes a potential null pointer dereference. Patch 2 takes care
of a suppressed return code and patch 3 corrects the system EID in the
ISM driver.
====================

Link: https://lore.kernel.org/r/20201023184830.59548-1-kgraul@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
kuba-moo committed Oct 26, 2020
2 parents af545bb + 1dc0d1c commit 522ee51
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/s390/net/ism_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static int ism_move(struct smcd_dev *smcd, u64 dmb_tok, unsigned int idx,
}

static struct ism_systemeid SYSTEM_EID = {
.seid_string = "IBM-SYSZ-IBMSEID00000000",
.seid_string = "IBM-SYSZ-ISMSEID00000000",
.serial_number = "0000",
.type = "0000",
};
Expand Down
7 changes: 4 additions & 3 deletions net/smc/af_smc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,10 +1317,10 @@ static void smc_listen_out_err(struct smc_sock *new_smc)

/* listen worker: decline and fall back if possible */
static void smc_listen_decline(struct smc_sock *new_smc, int reason_code,
struct smc_init_info *ini, u8 version)
int local_first, u8 version)
{
/* RDMA setup failed, switch back to TCP */
if (ini->first_contact_local)
if (local_first)
smc_lgr_cleanup_early(&new_smc->conn);
else
smc_conn_free(&new_smc->conn);
Expand Down Expand Up @@ -1768,7 +1768,8 @@ static void smc_listen_work(struct work_struct *work)
out_unlock:
mutex_unlock(&smc_server_lgr_pending);
out_decl:
smc_listen_decline(new_smc, rc, ini, version);
smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0,
version);
out_free:
kfree(ini);
kfree(buf);
Expand Down
7 changes: 5 additions & 2 deletions net/smc/smc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1615,8 +1615,11 @@ static struct smc_buf_desc *smcd_new_buf_create(struct smc_link_group *lgr,
rc = smc_ism_register_dmb(lgr, bufsize, buf_desc);
if (rc) {
kfree(buf_desc);
return (rc == -ENOMEM) ? ERR_PTR(-EAGAIN) :
ERR_PTR(-EIO);
if (rc == -ENOMEM)
return ERR_PTR(-EAGAIN);
if (rc == -ENOSPC)
return ERR_PTR(-ENOSPC);
return ERR_PTR(-EIO);
}
buf_desc->pages = virt_to_page(buf_desc->cpu_addr);
/* CDC header stored in buf. So, pretend it was smaller */
Expand Down

0 comments on commit 522ee51

Please sign in to comment.