[openib-general] [PATCH] OpenSM/libvendor: Fix some size_t issues related to memory allocation in osm_vendor_ibumad.c
Hal Rosenstock
halr at voltaire.com
Fri Feb 17 08:39:07 PST 2006
OpenSM/libvendor: In osm_vendor_ibumad.c, fix some size_t issues related
to memory allocation
Signed-off-by: Hal Rosenstock <halr at voltaire.com>
Index: libibumad/include/infiniband/umad.h
===================================================================
--- libibumad/include/infiniband/umad.h (revision 5436)
+++ libibumad/include/infiniband/umad.h (working copy)
@@ -160,7 +160,7 @@ int umad_open_port(char *ca_name, int po
int umad_close_port(int portid);
void * umad_get_mad(void *umad);
-int umad_size(void);
+size_t umad_size(void);
int umad_status(void *umad);
ib_mad_addr_t *umad_get_mad_addr(void *umad);
@@ -189,7 +189,7 @@ void umad_dump(void *umad);
#include <stdlib.h>
static inline void *
-umad_alloc(int num, int size) /* alloc array of umad buffers */
+umad_alloc(int num, size_t size) /* alloc array of umad buffers */
{
return calloc(num, size);
}
Index: libibumad/src/umad.c
===================================================================
--- libibumad/src/umad.c (revision 5436)
+++ libibumad/src/umad.c (working copy)
@@ -672,7 +672,7 @@ umad_get_mad(void *umad)
return ((struct ib_user_mad *)umad)->data;
}
-int
+size_t
umad_size(void)
{
return sizeof (struct ib_user_mad);
More information about the general
mailing list