[openib-general] [srptools] [PATCH] style fix in asprintf result check

Dotan Barak dotanb at dev.mellanox.co.il
Tue Jan 16 02:56:59 PST 2007


Check that the result of asprintf is negative 
(like it being done in all asprintf checks).

Signed-off-by: Dotan Barak <dotanb at mellanox.co.il>
---

Index: gen2_devel_user/src/userspace/srptools/srp_daemon/srp_daemon.c
===================================================================
--- gen2_devel_user.orig/src/userspace/srptools/srp_daemon/srp_daemon.c	2007-01-15 17:02:21.000000000 +0200
+++ gen2_devel_user/src/userspace/srptools/srp_daemon/srp_daemon.c	2007-01-16 10:02:50.000000000 +0200
@@ -1209,7 +1209,7 @@ static int umad_resources_create(struct 
 	ret = asprintf(&umad_res->port_sysfs_path, "%s/class/infiniband/%s/ports/%d",
 		       sysfs_path, config->dev_name, config->port_num);
 
-	if (ret == -1) {
+	if (ret < 0) {
 		umad_res->port_sysfs_path = NULL;
 		return -ENOMEM;
 	}






More information about the general mailing list