From 6a80ed4d2c26b5934f3bfb9beafe73a9c7946d34 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 17 Mar 2015 10:55:50 +0100 Subject: [PATCH] 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 --- drivers/staging/greybus/pwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5