Re: [PATCH] pinctrl: madera: Fix uninitialized variable issue in madera_mux_set_mux

2018-10-10 Thread Gustavo A. R. Silva
Hi Charles, > I don't believe this would fully address the issue since if you > initialise ret to -1 you will still drop into the if statement > and you will use the reg variable which should also be > uninitialised on that code path. > > Feels like initialising to 0 would probably be better

Re: [PATCH] pinctrl: madera: Fix uninitialized variable issue in madera_mux_set_mux

2018-10-10 Thread Gustavo A. R. Silva
Hi Charles, > I don't believe this would fully address the issue since if you > initialise ret to -1 you will still drop into the if statement > and you will use the reg variable which should also be > uninitialised on that code path. > > Feels like initialising to 0 would probably be better

Re: [PATCH] pinctrl: madera: Fix uninitialized variable issue in madera_mux_set_mux

2018-10-10 Thread Charles Keepax
On Wed, Oct 10, 2018 at 04:13:53PM +0200, Gustavo A. R. Silva wrote: > There is a potential execution path in which variable *ret* is checked > in an IF statement, and then its value is used to report an error at > line 659 without being properly initialized previously: > > 659 if (ret) > 660

Re: [PATCH] pinctrl: madera: Fix uninitialized variable issue in madera_mux_set_mux

2018-10-10 Thread Charles Keepax
On Wed, Oct 10, 2018 at 04:13:53PM +0200, Gustavo A. R. Silva wrote: > There is a potential execution path in which variable *ret* is checked > in an IF statement, and then its value is used to report an error at > line 659 without being properly initialized previously: > > 659 if (ret) > 660

[PATCH] pinctrl: madera: Fix uninitialized variable issue in madera_mux_set_mux

2018-10-10 Thread Gustavo A. R. Silva
There is a potential execution path in which variable *ret* is checked in an IF statement, and then its value is used to report an error at line 659 without being properly initialized previously: 659 if (ret) 660 dev_err(priv->dev, "Failed to write to 0x%x (%d)\n", reg, ret); Fix this by

[PATCH] pinctrl: madera: Fix uninitialized variable issue in madera_mux_set_mux

2018-10-10 Thread Gustavo A. R. Silva
There is a potential execution path in which variable *ret* is checked in an IF statement, and then its value is used to report an error at line 659 without being properly initialized previously: 659 if (ret) 660 dev_err(priv->dev, "Failed to write to 0x%x (%d)\n", reg, ret); Fix this by