From: Bart Van Assche Date: Tue, 14 Feb 2017 18:56:34 +0000 (-0800) Subject: IB/srp: Improve an error path X-Git-Tag: MMI-PSA29.97-13-9~6131^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b02c15360b17dde352fbf4003e20dabcd3ae9157;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git IB/srp: Improve an error path Avoid that the following message is printed if login fails: scsi host0: ib_srp: Sending CM DREQ failed Signed-off-by: Bart Van Assche Cc: Israel Rukshin Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 33dd0920c248..e8225cc8b938 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -3440,7 +3440,7 @@ static ssize_t srp_create_target(struct device *dev, target->ch_count, ch->target->orig_dgid.raw); if (node_idx == 0 && cpu_idx == 0) { - goto err_disconnect; + goto free_ch; } else { srp_free_ch_ib(target, ch); srp_free_req_data(target, ch); @@ -3487,6 +3487,7 @@ put: err_disconnect: srp_disconnect_target(target); +free_ch: for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; srp_free_ch_ib(target, ch);