public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* cxgb4 missing error handling?
@ 2010-08-04 21:17 Roland Dreier
       [not found] ` <adafwyu6pt0.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Dreier @ 2010-08-04 21:17 UTC (permalink / raw)
  To: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

in cm.c we have:

int c4iw_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
{
	int err;
	struct c4iw_ep *ep = to_ep(cm_id);
	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);

	if (state_read(&ep->com) == DEAD) {
		c4iw_put_ep(&ep->com);
		return -ECONNRESET;
	}
	BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD);
	if (mpa_rev == 0)
		abort_connection(ep, NULL, GFP_KERNEL);
	else {
		err = send_mpa_reject(ep, pdata, pdata_len);
		err = c4iw_ep_disconnect(ep, 0, GFP_KERNEL);
	}
	c4iw_put_ep(&ep->com);
	return 0;
}

latest gcc warns that the variable err is assigned to but never used --
and indeed it seems this code either should be doing something in the
failure case or not even storing the return value if it doesn't care.

Which one is it though?

 - R.
-- 
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cxgb4 missing error handling?
       [not found] ` <adafwyu6pt0.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
@ 2010-08-04 21:27   ` Steve Wise
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Wise @ 2010-08-04 21:27 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

On 08/04/2010 04:17 PM, Roland Dreier wrote:
> in cm.c we have:
>
> int c4iw_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
> {
> 	int err;
> 	struct c4iw_ep *ep = to_ep(cm_id);
> 	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
>
> 	if (state_read(&ep->com) == DEAD) {
> 		c4iw_put_ep(&ep->com);
> 		return -ECONNRESET;
> 	}
> 	BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD);
> 	if (mpa_rev == 0)
> 		abort_connection(ep, NULL, GFP_KERNEL);
> 	else {
> 		err = send_mpa_reject(ep, pdata, pdata_len);
> 		err = c4iw_ep_disconnect(ep, 0, GFP_KERNEL);
> 	}
> 	c4iw_put_ep(&ep->com);
> 	return 0;
> }
>
> latest gcc warns that the variable err is assigned to but never used --
> and indeed it seems this code either should be doing something in the
> failure case or not even storing the return value if it doesn't care.
>
> Which one is it though?
>
>   - R.
>    

Good question. :)

I think we should get rid of 'err' altogether and ignore return values 
from send_mpa_reject() and c4iw_ep_disconnect().




--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-04 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-04 21:17 cxgb4 missing error handling? Roland Dreier
     [not found] ` <adafwyu6pt0.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
2010-08-04 21:27   ` Steve Wise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox