diff mbox

[rdma-next] iw_cxgb4: print mapped ports correctly

Message ID 20180329114013.16465-1-bharat@chelsio.com (mailing list archive)
State Accepted
Headers show

Commit Message

Potnuri Bharat Teja March 29, 2018, 11:40 a.m. UTC
c4iw_ep_common structure holds the mapped addresses, so while printing
them, use appropriate pointers.

Fixes: bab572f1d ("iw_cxgb4: Guard against null cm_id in dump_ep/qp")

Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
---
 drivers/infiniband/hw/cxgb4/device.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

Comments

Jason Gunthorpe March 29, 2018, 10:17 p.m. UTC | #1
On Thu, Mar 29, 2018 at 05:10:13PM +0530, Potnuri Bharat Teja wrote:
> c4iw_ep_common structure holds the mapped addresses, so while printing
> them, use appropriate pointers.
> 
> Fixes: bab572f1d ("iw_cxgb4: Guard against null cm_id in dump_ep/qp")
> Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
>  drivers/infiniband/hw/cxgb4/device.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)

Applied to for-next

> diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
> index 7a9d0de89d6a..5ce3cd1884b5 100644
> +++ b/drivers/infiniband/hw/cxgb4/device.c
> @@ -220,14 +220,14 @@ static void set_ep_sin_addrs(struct c4iw_ep *ep,
>  {
>  	struct iw_cm_id *id = ep->com.cm_id;
>  
> -	*lsin = (struct sockaddr_in *)&ep->com.local_addr;
> -	*rsin = (struct sockaddr_in *)&ep->com.remote_addr;
> +	*m_lsin = (struct sockaddr_in *)&ep->com.local_addr;
> +	*m_rsin = (struct sockaddr_in *)&ep->com.remote_addr;
>  	if (id) {
> -		*m_lsin = (struct sockaddr_in *)&id->m_local_addr;
> -		*m_rsin = (struct sockaddr_in *)&id->m_remote_addr;
> +		*lsin = (struct sockaddr_in *)&id->local_addr;
> +		*rsin = (struct sockaddr_in *)&id->remote_addr;

Although the commit comment in bab572f1d should have explained why
this code switched from from cm_id->m_local_addr to com.local_addr ..

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

Patch

diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 7a9d0de89d6a..5ce3cd1884b5 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -220,14 +220,14 @@  static void set_ep_sin_addrs(struct c4iw_ep *ep,
 {
 	struct iw_cm_id *id = ep->com.cm_id;
 
-	*lsin = (struct sockaddr_in *)&ep->com.local_addr;
-	*rsin = (struct sockaddr_in *)&ep->com.remote_addr;
+	*m_lsin = (struct sockaddr_in *)&ep->com.local_addr;
+	*m_rsin = (struct sockaddr_in *)&ep->com.remote_addr;
 	if (id) {
-		*m_lsin = (struct sockaddr_in *)&id->m_local_addr;
-		*m_rsin = (struct sockaddr_in *)&id->m_remote_addr;
+		*lsin = (struct sockaddr_in *)&id->local_addr;
+		*rsin = (struct sockaddr_in *)&id->remote_addr;
 	} else {
-		*m_lsin = &zero_sin;
-		*m_rsin = &zero_sin;
+		*lsin = &zero_sin;
+		*rsin = &zero_sin;
 	}
 }
 
@@ -239,14 +239,14 @@  static void set_ep_sin6_addrs(struct c4iw_ep *ep,
 {
 	struct iw_cm_id *id = ep->com.cm_id;
 
-	*lsin6 = (struct sockaddr_in6 *)&ep->com.local_addr;
-	*rsin6 = (struct sockaddr_in6 *)&ep->com.remote_addr;
+	*m_lsin6 = (struct sockaddr_in6 *)&ep->com.local_addr;
+	*m_rsin6 = (struct sockaddr_in6 *)&ep->com.remote_addr;
 	if (id) {
-		*m_lsin6 = (struct sockaddr_in6 *)&id->m_local_addr;
-		*m_rsin6 = (struct sockaddr_in6 *)&id->m_remote_addr;
+		*lsin6 = (struct sockaddr_in6 *)&id->local_addr;
+		*rsin6 = (struct sockaddr_in6 *)&id->remote_addr;
 	} else {
-		*m_lsin6 = &zero_sin6;
-		*m_rsin6 = &zero_sin6;
+		*lsin6 = &zero_sin6;
+		*rsin6 = &zero_sin6;
 	}
 }