[openib-general] [PATCH 09/12] SRP: Changing ibsrpdm

Ishai Rabinovitz ishai at mellanox.co.il
Mon May 1 04:30:19 PDT 2006


alloca man page on my system says:
	The alloca()  function is machine and compiler dependent. 
	On many systems its implementation is buggy. Its use is discouraged.
Lets not use it.

Signed-off-by: Ishai Rabinovitz <ishai at mellanox.co.il>

Index: last_stable/src/userspace/srptools/src/srp-dm.c
===================================================================
--- last_stable.orig/src/userspace/srptools/src/srp-dm.c	2006-04-16 13:09:07.000000000 +0300
+++ last_stable/src/userspace/srptools/src/srp-dm.c	2006-04-16 13:11:17.000000000 +0300
@@ -510,7 +510,8 @@ again:
 
 int get_port_list(int fd, uint32_t agent[2])
 {
-	struct ib_user_mad		out_mad, *in_mad;
+	uint8_t				in_mad_space[SIZE_OF_QUERY_RESPONSE];
+	struct ib_user_mad		out_mad, *in_mad=(void *) in_mad_space;
 	struct srp_dm_rmpp_sa_mad      *out_sa_mad, *in_sa_mad;
 	struct srp_sa_node_rec	       *node;
 	ssize_t len;
@@ -521,8 +522,6 @@ int get_port_list(int fd, uint32_t agent
 	uint64_t subnet_prefix;
 	int isdm;
 
-	in_mad    = alloca(SIZE_OF_QUERY_RESPONSE);
-
 	in_sa_mad  = (void *) in_mad->data;
 	out_sa_mad = (void *) out_mad.data;
 
-- 
Ishai Rabinovitz



More information about the general mailing list