Commit 3ebd3da6 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pwm/for-3.14-rc5' of...

Merge tag 'pwm/for-3.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm

Pull pwm fix from Thierry Reding:
 "Just a single trivial patch to plug a memory leak in an error path"

* tag 'pwm/for-3.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
  pwm: lp3943: Fix potential memory leak during request
parents 8d753182 0b7d25c3
...@@ -52,8 +52,10 @@ lp3943_pwm_request_map(struct lp3943_pwm *lp3943_pwm, int hwpwm) ...@@ -52,8 +52,10 @@ lp3943_pwm_request_map(struct lp3943_pwm *lp3943_pwm, int hwpwm)
offset = pwm_map->output[i]; offset = pwm_map->output[i];
/* Return an error if the pin is already assigned */ /* Return an error if the pin is already assigned */
if (test_and_set_bit(offset, &lp3943->pin_used)) if (test_and_set_bit(offset, &lp3943->pin_used)) {
kfree(pwm_map);
return ERR_PTR(-EBUSY); return ERR_PTR(-EBUSY);
}
} }
return pwm_map; return pwm_map;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment