[PATCH 2/3] pwm-core: fix error handling in pwmchip_add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

* this patch fix error handling in pwmchip_add

Signed-off-by: Eric Bénard <eric@xxxxxxxxxx>
---
 drivers/pwm/core.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 47e6262..b3a99a6 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -216,8 +216,10 @@ int pwmchip_add(struct pwm_chip *chip)
 		goto out;
 
 	chip->pwms = kzalloc(chip->npwm * sizeof(*pwm), GFP_KERNEL);
-	if (!chip->pwms)
-		return -ENOMEM;
+	if (!chip->pwms) {
+		ret = -ENOMEM;
+		goto out;
+	}
 
 	chip->base = ret;
 
-- 
1.7.7.6


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter