Browse Source

IB/srp: Fix memory leak in options parsing

Fix memory leak if parsing destination GID fails.

Coverity bug 1042

Signed-off-by: Roland Dreier <rolandd@cisco.com>
Roland Dreier 19 years ago
parent
commit
ce1823f032
1 changed files with 1 additions and 0 deletions
  1. 1 0
      drivers/infiniband/ulp/srp/ib_srp.c

+ 1 - 0
drivers/infiniband/ulp/srp/ib_srp.c

@@ -1434,6 +1434,7 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
 			p = match_strdup(args);
 			if (strlen(p) != 32) {
 				printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p);
+				kfree(p);
 				goto out;
 			}