svn commit: r352831 - head/sys/contrib/ncsw/Peripherals/BM

Justin Hibbits jhibbits at FreeBSD.org
Sat Sep 28 02:49:46 UTC 2019


Author: jhibbits
Date: Sat Sep 28 02:49:46 2019
New Revision: 352831
URL: https://svnweb.freebsd.org/changeset/base/352831

Log:
  dpaa(4): Fix memcpy size for threshold copy in NCSW contrib
  
  On 64-bit platforms uintptr_t makes the copy twice as large as it should be.
  This code isn't actually used in FreeBSD, since it's for guest mode only,
  not hypervisor mode, but fixing it for completeness sake.
  
  Reported by:	bdragon (clang9 build)

Modified:
  head/sys/contrib/ncsw/Peripherals/BM/bm.c

Modified: head/sys/contrib/ncsw/Peripherals/BM/bm.c
==============================================================================
--- head/sys/contrib/ncsw/Peripherals/BM/bm.c	Sat Sep 28 02:15:23 2019	(r352830)
+++ head/sys/contrib/ncsw/Peripherals/BM/bm.c	Sat Sep 28 02:49:46 2019	(r352831)
@@ -258,7 +258,7 @@ t_Error BmSetPoolThresholds(t_Handle h_Bm, uint8_t bpi
 
         memset(&msg, 0, sizeof(t_BmIpcMsg));
         ipcPoolThresh.bpid  = bpid;
-        memcpy(ipcPoolThresh.thresholds, thresholds, sizeof(uintptr_t) * MAX_DEPLETION_THRESHOLDS);
+        memcpy(ipcPoolThresh.thresholds, thresholds, sizeof(uint32_t) * MAX_DEPLETION_THRESHOLDS);
         msg.msgId           = BM_SET_POOL_THRESH;
         memcpy(msg.msgBody, &ipcPoolThresh, sizeof(t_BmIpcPoolThreshParams));
         if ((errCode = XX_IpcSendMessage(p_Bm->h_Session,


More information about the svn-src-head mailing list