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 fd8a95a9c5d3e6f26e9927df9f8a53ea8ce06ab6..5f2b3f6e4c4777c5a775627ba703669e66e5828c 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;
                        }