net/qede/base: use the correct size value
authorRasesh Mody <rasesh.mody@cavium.com>
Sat, 7 Oct 2017 06:31:01 +0000 (23:31 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 12 Oct 2017 00:36:58 +0000 (01:36 +0100)
Use the correct size value while copying chassis/port id values.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore_dcbx.c

index 97fd484..201b7d5 100644 (file)
@@ -684,9 +684,9 @@ static void ecore_dcbx_get_local_lldp_params(struct ecore_hwfn *p_hwfn,
 
        OSAL_MEMCPY(params->lldp_local.local_chassis_id,
                    p_local->local_chassis_id,
-                   OSAL_ARRAY_SIZE(p_local->local_chassis_id));
+                   sizeof(params->lldp_local.local_chassis_id));
        OSAL_MEMCPY(params->lldp_local.local_port_id, p_local->local_port_id,
-                   OSAL_ARRAY_SIZE(p_local->local_port_id));
+                   sizeof(params->lldp_local.local_port_id));
 }
 
 static void ecore_dcbx_get_remote_lldp_params(struct ecore_hwfn *p_hwfn,
@@ -698,9 +698,9 @@ static void ecore_dcbx_get_remote_lldp_params(struct ecore_hwfn *p_hwfn,
 
        OSAL_MEMCPY(params->lldp_remote.peer_chassis_id,
                    p_remote->peer_chassis_id,
-                   OSAL_ARRAY_SIZE(p_remote->peer_chassis_id));
+                   sizeof(params->lldp_remote.peer_chassis_id));
        OSAL_MEMCPY(params->lldp_remote.peer_port_id, p_remote->peer_port_id,
-                   OSAL_ARRAY_SIZE(p_remote->peer_port_id));
+                   sizeof(params->lldp_remote.peer_port_id));
 }
 
 static enum _ecore_status_t