On 01/13/18 19:17, Cy Schubert wrote:
In message <201801132230.w0dmuvmf081...@repo.freebsd.org>, "Pedro F.
Giffuni" w
rites:
Author: pfg
Date: Sat Jan 13 22:30:30 2018
New Revision: 327949
URL: https://svnweb.freebsd.org/changeset/base/327949

Log:
   dev: make some use of mallocarray(9).
Focus on code where we are doing multiplications within malloc(9). None of
   these is likely to overflow, however the change is still useful as some
   static checkers can benefit from the allocation attributes we use for
   mallocarray.
This initial sweep only covers malloc(9) calls with M_NOWAIT. No good
   reason but I started doing the changes before r327796 and at that time it
   was convenient to make sure the sorrounding code could handle NULL values.

Modified:
   head/sys/dev/aacraid/aacraid.c
   head/sys/dev/advansys/advansys.c
   head/sys/dev/ath/if_ath_rx_edma.c
   head/sys/dev/beri/virtio/virtio.c
   head/sys/dev/bnxt/if_bnxt.c
   head/sys/dev/bwn/if_bwn.c
   head/sys/dev/bwn/if_bwn_phy_lp.c
   head/sys/dev/ciss/ciss.c
   head/sys/dev/cxgbe/crypto/t4_crypto.c
   head/sys/dev/esp/ncr53c9x.c
   head/sys/dev/fb/splash.c
   head/sys/dev/gpio/gpiobus.c
   head/sys/dev/if_ndis/if_ndis.c
   head/sys/dev/iwi/if_iwi.c
   head/sys/dev/kbd/kbd.c
   head/sys/dev/liquidio/base/lio_request_manager.c
   head/sys/dev/liquidio/lio_main.c
   head/sys/dev/mpr/mpr.c
   head/sys/dev/mpr/mpr_mapping.c
   head/sys/dev/mps/mps.c
   head/sys/dev/mps/mps_mapping.c
   head/sys/dev/mpt/mpt_cam.c
   head/sys/dev/mrsas/mrsas.c
   head/sys/dev/mxge/if_mxge.c
   head/sys/dev/netmap/if_ptnet.c
   head/sys/dev/nvme/nvme_ns.c
   head/sys/dev/pst/pst-iop.c
   head/sys/dev/ral/rt2560.c
   head/sys/dev/ral/rt2661.c
   head/sys/dev/rp/rp.c
   head/sys/dev/rp/rp_isa.c
   head/sys/dev/rp/rp_pci.c
   head/sys/dev/sound/midi/midi.c
   head/sys/dev/sound/pci/hda/hdaa.c
   head/sys/dev/syscons/fire/fire_saver.c
   head/sys/dev/virtio/console/virtio_console.c
   head/sys/dev/virtio/mmio/virtio_mmio.c
   head/sys/dev/virtio/network/if_vtnet.c
   head/sys/dev/virtio/pci/virtio_pci.c
   head/sys/dev/vmware/vmxnet3/if_vmx.c
   head/sys/dev/vnic/nicvf_queues.c
   head/sys/dev/xen/blkback/blkback.c
   head/sys/dev/xen/blkfront/blkfront.c


Modified: head/sys/dev/mxge/if_mxge.c
=============================================================================
=
--- head/sys/dev/mxge/if_mxge.c Sat Jan 13 21:39:46 2018        (r32794
8)
+++ head/sys/dev/mxge/if_mxge.c Sat Jan 13 22:30:30 2018        (r32794
9)
@@ -688,7 +688,7 @@ z_alloc(void *nil, u_int items, u_int size)
  {
        void *ptr;
- ptr = malloc(items * size, M_TEMP, M_NOWAIT);
+       ptr = mallocarray(items, size, M_TEMP, M_NOWAIT);
        return ptr;
  }
@@ -4390,8 +4390,8 @@ mxge_alloc_slices(mxge_softc_t *sc)
        sc->rx_ring_size = cmd.data0;
        max_intr_slots = 2 * (sc->rx_ring_size / sizeof (mcp_dma_addr_t));
        
-       bytes = sizeof (*sc->ss) * sc->num_slices;
Hi Pedro,

This broke the build.

Very sorry ... should be fixed now (r327949).

Thanks!

Pedro.

_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to