diff options
| author | Ursula Braun <ubraun@linux.ibm.com> | 2019-10-10 04:16:09 -0400 |
|---|---|---|
| committer | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-10-10 22:08:41 -0400 |
| commit | 29ee2701529e1905c0e948688f9688c68c8d4ea4 (patch) | |
| tree | b493cb1a56ab3459792bb0d51e1a080c05427730 /net | |
| parent | 2168da4594040529f6a6cb413c22668a4402f83c (diff) | |
net/smc: fix SMCD link group creation with VLAN id
If creation of an SMCD link group with VLAN id fails, the initial
smc_ism_get_vlan() step has to be reverted as well.
Fixes: c6ba7c9ba43d ("net/smc: add base infrastructure for SMC-D and ISM")
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/smc/smc_core.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 4ca50ddf8d16..88556f0251ab 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c | |||
| @@ -213,7 +213,7 @@ static int smc_lgr_create(struct smc_sock *smc, struct smc_init_info *ini) | |||
| 213 | lgr = kzalloc(sizeof(*lgr), GFP_KERNEL); | 213 | lgr = kzalloc(sizeof(*lgr), GFP_KERNEL); |
| 214 | if (!lgr) { | 214 | if (!lgr) { |
| 215 | rc = SMC_CLC_DECL_MEM; | 215 | rc = SMC_CLC_DECL_MEM; |
| 216 | goto out; | 216 | goto ism_put_vlan; |
| 217 | } | 217 | } |
| 218 | lgr->is_smcd = ini->is_smcd; | 218 | lgr->is_smcd = ini->is_smcd; |
| 219 | lgr->sync_err = 0; | 219 | lgr->sync_err = 0; |
| @@ -289,6 +289,9 @@ clear_llc_lnk: | |||
| 289 | smc_llc_link_clear(lnk); | 289 | smc_llc_link_clear(lnk); |
| 290 | free_lgr: | 290 | free_lgr: |
| 291 | kfree(lgr); | 291 | kfree(lgr); |
| 292 | ism_put_vlan: | ||
| 293 | if (ini->is_smcd && ini->vlan_id) | ||
| 294 | smc_ism_put_vlan(ini->ism_dev, ini->vlan_id); | ||
| 292 | out: | 295 | out: |
| 293 | if (rc < 0) { | 296 | if (rc < 0) { |
| 294 | if (rc == -ENOMEM) | 297 | if (rc == -ENOMEM) |
