greybus: pwm: fix memory leak in error path
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 17 Mar 2015 09:55:50 +0000 (10:55 +0100)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 17 Mar 2015 21:32:58 +0000 (22:32 +0100)
Fix memory leak in connection_init error path.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/pwm.c

index e2ab6f5..3f508bf 100644 (file)
@@ -261,7 +261,7 @@ static int gb_pwm_connection_init(struct gb_connection *connection)
        ret = pwmchip_add(pwm);
        if (ret) {
                pr_err("Failed to register PWM\n");
-               return ret;
+               goto out_err;
        }
 
        return 0;