All of lore.kernel.org
 help / color / mirror / Atom feed
* [infiniband-core] question about arguments position
@ 2017-05-04 17:42 Gustavo A. R. Silva
       [not found] ` <20170504124209.Horde.B4I2tu9lZ9_KMd07dtjWcl2-fU+oOHjIBR1LoJgMfuPDHBfZZeVsHd8q@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-04 17:42 UTC (permalink / raw)
  To: Doug Ledford, Sean Hefty, Hal Rosenstock, Sagi Grimberg,
	Bart Van Assche, Steve Wise, Leon Romanovsky, Yishai Hadas,
	Moni Shoua
  Cc: linux-rdma, linux-kernel


Hello everybody,

While looking into Coverity ID 1351047 I ran into the following piece  
of code at drivers/infiniband/core/verbs.c:496:

ret = rdma_addr_find_l2_eth_by_grh(&dgid, &sgid,
                                    ah_attr->dmac,
                                    wc->wc_flags & IB_WC_WITH_VLAN ?
                                    NULL : &vlan_id,
                                    &if_index, &hoplimit);


The issue here is that the position of arguments in the call to  
rdma_addr_find_l2_eth_by_grh() function do not match the order of the  
parameters:

&dgid is passed to sgid
&sgid is passed to dgid

This is the function prototype:

int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
				 const union ib_gid *dgid,
				 u8 *dmac, u16 *vlan_id, int *if_index,
				 int *hoplimit)

My question here is if this is intentional?

In case it is not, I will send a patch to fix it. But first it would  
be great to hear any comment about it.

Thank you
--
Gustavo A. R. Silva

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

end of thread, other threads:[~2017-05-05  1:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-04 17:42 [infiniband-core] question about arguments position Gustavo A. R. Silva
     [not found] ` <20170504124209.Horde.B4I2tu9lZ9_KMd07dtjWcl2-fU+oOHjIBR1LoJgMfuPDHBfZZeVsHd8q@public.gmane.org>
2017-05-04 21:52   ` Parav Pandit
2017-05-04 21:52     ` Parav Pandit
     [not found]     ` <DB6PR0502MB2999ABEFF47AEBF944F8B65BD1EA0-wTfl6qNNZ1N9V1xQXiTFbsDSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-05-04 23:49       ` Doug Ledford
2017-05-04 23:49         ` Doug Ledford
2017-05-05  1:38         ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.