IB/srp: Fix memory leak in options parsing
authorRoland Dreier <rolandd@cisco.com>
Mon, 3 Apr 2006 16:31:04 +0000 (09:31 -0700)
committerRoland Dreier <rolandd@cisco.com>
Mon, 3 Apr 2006 16:31:04 +0000 (09:31 -0700)
Fix memory leak if parsing destination GID fails.

Coverity bug 1042

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/srp/ib_srp.c

index fd8a95a..5f2b3f6 100644 (file)
@@ -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;
                        }