Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pwm/for-6.8-2' of gitolite.kernel.org:pub/scm/linux/kernel/git/ukleinek/linux

Pull pwm fixes from Uwe Kleine-König:

- fix a duplicate cleanup in an error path introduced in
this merge window

- fix an out-of-bounds access

In practise it doesn't happen - otherwise someone would have noticed
since v5.17-rc1 I guess - because the device tree binding for the two
drivers using of_pwm_single_xlate() only have args->args_count == 1.

A device-tree that doesn't conform to the respective bindings could
trigger that easily however.

- correct the request callback of the jz4740 pwm driver which used
dev_err_probe() long after .probe() completed.

This is conceptually wrong because dev_err_probe() might call
device_set_deferred_probe_reason() which is nonsensical after the
driver is bound.

* tag 'pwm/for-6.8-2' of gitolite.kernel.org:pub/scm/linux/kernel/git/ukleinek/linux:
pwm: jz4740: Don't use dev_err_probe() in .request()
pwm: Fix out-of-bounds access in of_pwm_single_xlate()
pwm: bcm2835: Remove duplicate call to clk_rate_exclusive_put()

+6 -7
+1 -1
drivers/pwm/core.c
··· 152 152 pwm->args.period = args->args[0]; 153 153 pwm->args.polarity = PWM_POLARITY_NORMAL; 154 154 155 - if (args->args_count == 2 && args->args[2] & PWM_POLARITY_INVERTED) 155 + if (args->args_count == 2 && args->args[1] & PWM_POLARITY_INVERTED) 156 156 pwm->args.polarity = PWM_POLARITY_INVERSED; 157 157 158 158 return pwm;
+1 -3
drivers/pwm/pwm-bcm2835.c
··· 160 160 161 161 ret = devm_add_action_or_reset(&pdev->dev, devm_clk_rate_exclusive_put, 162 162 pc->clk); 163 - if (ret) { 164 - clk_rate_exclusive_put(pc->clk); 163 + if (ret) 165 164 return ret; 166 - } 167 165 168 166 pc->rate = clk_get_rate(pc->clk); 169 167 if (!pc->rate)
+4 -3
drivers/pwm/pwm-jz4740.c
··· 61 61 snprintf(name, sizeof(name), "timer%u", pwm->hwpwm); 62 62 63 63 clk = clk_get(chip->dev, name); 64 - if (IS_ERR(clk)) 65 - return dev_err_probe(chip->dev, PTR_ERR(clk), 66 - "Failed to get clock\n"); 64 + if (IS_ERR(clk)) { 65 + dev_err(chip->dev, "error %pe: Failed to get clock\n", clk); 66 + return PTR_ERR(clk); 67 + } 67 68 68 69 err = clk_prepare_enable(clk); 69 70 if (err < 0) {