diff mbox

i40iw: Use correct src address in memcpy to rdma stats counters

Message ID 1478883341-22124-1-git-send-email-shiraz.saleem@intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Shiraz Saleem Nov. 11, 2016, 4:55 p.m. UTC
hw_stats is a pointer to i40_iw_dev_stats struct in i40iw_get_hw_stats().
Use hw_stats and not &hw_stats in the memcpy to copy the i40iw device stats
data into rdma_hw_stats counters.

Fixes: b40f4757daa1 ("IB/core: Make device counter infrastructure dynamic")

Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Faisal Latif <faisal.latif@intel.com>
---
 drivers/infiniband/hw/i40iw/i40iw_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Shiraz Saleem Dec. 6, 2016, 5:39 p.m. UTC | #1
Doug - Can you please pick this up for 4.9? It was a bug introduced in 4.7. 


On Fri, Nov 11, 2016 at 09:55:41AM -0700, Saleem, Shiraz wrote:
> hw_stats is a pointer to i40_iw_dev_stats struct in i40iw_get_hw_stats().
> Use hw_stats and not &hw_stats in the memcpy to copy the i40iw device stats
> data into rdma_hw_stats counters.
> 
> Fixes: b40f4757daa1 ("IB/core: Make device counter infrastructure dynamic")
> 
> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> Signed-off-by: Faisal Latif <faisal.latif@intel.com>
> ---
>  drivers/infiniband/hw/i40iw/i40iw_verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> index b71394b..02c8f9a 100644
> --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> @@ -2498,7 +2498,7 @@ static int i40iw_get_hw_stats(struct ib_device *ibdev,
>  			return -ENOSYS;
>  	}
>  
> -	memcpy(&stats->value[0], &hw_stats, sizeof(*hw_stats));
> +	memcpy(&stats->value[0], hw_stats, sizeof(*hw_stats));
>  
>  	return stats->num_counters;
>  }
> -- 
> 2.8.0
> 
--
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
Doug Ledford Dec. 12, 2016, 10:20 p.m. UTC | #2
On 12/6/2016 12:39 PM, Shiraz Saleem wrote:
> Doug - Can you please pick this up for 4.9? It was a bug introduced in 4.7. 
> 
> 
> On Fri, Nov 11, 2016 at 09:55:41AM -0700, Saleem, Shiraz wrote:
>> hw_stats is a pointer to i40_iw_dev_stats struct in i40iw_get_hw_stats().
>> Use hw_stats and not &hw_stats in the memcpy to copy the i40iw device stats
>> data into rdma_hw_stats counters.
>>
>> Fixes: b40f4757daa1 ("IB/core: Make device counter infrastructure dynamic")
>>
>> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
>> Signed-off-by: Faisal Latif <faisal.latif@intel.com>
>> ---
>>  drivers/infiniband/hw/i40iw/i40iw_verbs.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
>> index b71394b..02c8f9a 100644
>> --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
>> +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
>> @@ -2498,7 +2498,7 @@ static int i40iw_get_hw_stats(struct ib_device *ibdev,
>>  			return -ENOSYS;
>>  	}
>>  
>> -	memcpy(&stats->value[0], &hw_stats, sizeof(*hw_stats));
>> +	memcpy(&stats->value[0], hw_stats, sizeof(*hw_stats));
>>  
>>  	return stats->num_counters;
>>  }
>> -- 
>> 2.8.0
>>

Picked up for the current kernel and stable tag added.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
index b71394b..02c8f9a 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -2498,7 +2498,7 @@  static int i40iw_get_hw_stats(struct ib_device *ibdev,
 			return -ENOSYS;
 	}
 
-	memcpy(&stats->value[0], &hw_stats, sizeof(*hw_stats));
+	memcpy(&stats->value[0], hw_stats, sizeof(*hw_stats));
 
 	return stats->num_counters;
 }