Some cxgbe/iw_cxgbe fixes:

- Free rt in c4iw_connect only if it is allocated.
- Call soclose instead of so_shutdown if there is an abort from the peer.
- Close socket and return failure if TOE is not enabled.

Submitted by:	Hariprasad at Chelsio dot com
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2014-10-27 22:22:46 +00:00
parent f1be09bd95
commit d25d06afc0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273750

View File

@ -474,7 +474,7 @@ process_conn_error(struct c4iw_ep *ep)
if (state != ABORTING) {
CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep);
close_socket(&ep->com, 0);
close_socket(&ep->com, 1);
state_set(&ep->com, DEAD);
c4iw_put_ep(&ep->com);
}
@ -2084,14 +2084,15 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
CTR2(KTR_IW_CXGBE, "%s:cc7 %p", __func__, ep);
printk(KERN_ERR MOD "%s - cannot find route.\n", __func__);
err = -EHOSTUNREACH;
goto fail3;
goto fail2;
}
if (!(rt->rt_ifp->if_flags & IFCAP_TOE)) {
if (!(rt->rt_ifp->if_capenable & IFCAP_TOE)) {
CTR2(KTR_IW_CXGBE, "%s:cc8 %p", __func__, ep);
printf("%s - interface not TOE capable.\n", __func__);
close_socket(&ep->com, 0);
err = -ENOPROTOOPT;
goto fail3;
}
tdev = TOEDEV(rt->rt_ifp);