Re: [Linux-stm32] [PATCH] pwm: stm32: Fix the usage of uninitialized variable in stm32_pwm_config()

2019-10-04 Thread Mark Brown
On Fri, Oct 04, 2019 at 10:08:04PM +0200, Uwe Kleine-König wrote: > On Fri, Oct 04, 2019 at 09:09:51AM +, Benjamin GAIGNARD wrote: > > like for the your patch in IIO trigger regmap_read could only failed > > if the hardware block is no more clocked and in this case we won't > > return of regm

Re: [Linux-stm32] [PATCH] pwm: stm32: Fix the usage of uninitialized variable in stm32_pwm_config()

2019-10-04 Thread Uwe Kleine-König
Hello, Cc += Mark Brown who maintains regmap On Fri, Oct 04, 2019 at 09:09:51AM +, Benjamin GAIGNARD wrote: > > On 10/4/19 8:23 AM, Uwe Kleine-König wrote: > > Hello, > > > > On Thu, Oct 03, 2019 at 09:46:49PM -0700, Yizhuo wrote: > >> Inside function stm32_pwm_config(), variable "psc" and "

Re: [Linux-stm32] [PATCH] pwm: stm32: Fix the usage of uninitialized variable in stm32_pwm_config()

2019-10-04 Thread Benjamin GAIGNARD
On 10/4/19 8:23 AM, Uwe Kleine-König wrote: > Hello, > > On Thu, Oct 03, 2019 at 09:46:49PM -0700, Yizhuo wrote: >> Inside function stm32_pwm_config(), variable "psc" and " arr" >> could be uninitialized if regmap_read() returns -EINVALs. >> However, they are used later in the if statement to deci

Re: [PATCH] pwm: stm32: Fix the usage of uninitialized variable in stm32_pwm_config()

2019-10-03 Thread Uwe Kleine-König
Hello, On Thu, Oct 03, 2019 at 09:46:49PM -0700, Yizhuo wrote: > Inside function stm32_pwm_config(), variable "psc" and " arr" > could be uninitialized if regmap_read() returns -EINVALs. > However, they are used later in the if statement to decide > the return value which is potentially unsafe. >

[PATCH] pwm: stm32: Fix the usage of uninitialized variable in stm32_pwm_config()

2019-10-03 Thread Yizhuo
Inside function stm32_pwm_config(), variable "psc" and " arr" could be uninitialized if regmap_read() returns -EINVALs. However, they are used later in the if statement to decide the return value which is potentially unsafe. The same case happens in function stm32_pwm_detect_channels() with variab