From: Johan Hovold Date: Tue, 17 Mar 2015 09:55:50 +0000 (+0100) Subject: greybus: pwm: fix memory leak in error path X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~1687 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6a80ed4d2c26b5934f3bfb9beafe73a9c7946d34;p=karo-tx-linux.git greybus: pwm: fix memory leak in error path Fix memory leak in connection_init error path. Signed-off-by: Johan Hovold Reviewed-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/pwm.c b/drivers/staging/greybus/pwm.c index e2ab6f5f610e..3f508bf66ec0 100644 --- a/drivers/staging/greybus/pwm.c +++ b/drivers/staging/greybus/pwm.c @@ -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;