diff options
author | Sangjung Woo <sangjung.woo@samsung.com> | 2013-11-05 11:08:34 +0900 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2013-11-15 13:52:57 +0900 |
commit | 38d35de94bd0778f1b68b2183c04fef2b585629d (patch) | |
tree | 381af9204fb5073940daeb8b5416b266b05716b0 | |
parent | b9d60b42a2ca9dd47a57b3f50006d60b3e3ec2bf (diff) | |
download | linux-3.10-38d35de94bd0778f1b68b2183c04fef2b585629d.tar.gz linux-3.10-38d35de94bd0778f1b68b2183c04fef2b585629d.tar.bz2 linux-3.10-38d35de94bd0778f1b68b2183c04fef2b585629d.zip |
pwm: samsung: memory leak bugfix in pwm_samsung_free
There is certainly a kind of memory leak since allocated data (i.e.
chip_data) is set NULL before freeing it by calling devm_kfree().This
patch fixes the memory leak bug by modifying its call order.
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Reviewed-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
-rw-r--r-- | drivers/pwm/pwm-samsung.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index fcc8b9adde9..07b2d9db9fb 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -224,8 +224,8 @@ static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm) static void pwm_samsung_free(struct pwm_chip *chip, struct pwm_device *pwm) { - pwm_set_chip_data(pwm, NULL); devm_kfree(chip->dev, pwm_get_chip_data(pwm)); + pwm_set_chip_data(pwm, NULL); } static int pwm_samsung_enable(struct pwm_chip *chip, struct pwm_device *pwm) |