Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-08-30 Thread David Miller
From: Yizhuo Zhai Date: Fri, 30 Aug 2019 15:29:07 -0700 > Thanks for your feedback, this patch should work for v4.14. You must always submit patches against the current tree.

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-08-30 Thread Yizhuo Zhai
Hi David: Thanks for your feedback, this patch should work for v4.14. On Fri, Feb 8, 2019 at 11:01 PM David Miller wrote: > > From: Yizhuo > Date: Thu, 7 Feb 2019 09:46:23 -0800 > > > In function sun8i_dwmac_set_syscon(), local variable "val" could > > be uninitialized if function regmap_read

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-08 Thread David Miller
From: Yizhuo Date: Thu, 7 Feb 2019 09:46:23 -0800 > In function sun8i_dwmac_set_syscon(), local variable "val" could > be uninitialized if function regmap_read() returns -EINVAL. > However, it will be used directly in the if statement, which > is potentially unsafe. > > Signed-off-by: Yizhuo

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-07 Thread Maxime Ripard
On Thu, Feb 07, 2019 at 09:46:23AM -0800, Yizhuo wrote: > In function sun8i_dwmac_set_syscon(), local variable "val" could > be uninitialized if function regmap_read() returns -EINVAL. > However, it will be used directly in the if statement, which > is potentially unsafe. > > Signed-off-by: Yizhuo

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-07 Thread David Miller
From: Yizhuo Zhai Date: Wed, 6 Feb 2019 21:52:15 -0800 > Thanks, but why initialization matters here? Is performance the main > concern? Code that is unnecessary is hard to audit. People will ask "why" is it initialized? In what situations is the initialized value of "0" ever used? You are wa

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-07 Thread Yizhuo Zhai
Make sense, I will send the new patch. Thanks for the opinion. On Thu, Feb 7, 2019 at 1:25 AM Maxime Ripard wrote: > > On Wed, Feb 06, 2019 at 09:53:16PM -0800, Yizhuo Zhai wrote: > > > > > > On Wed, Feb 6, 2019 at 9:52 PM Yizhuo Zhai wrote: > > > > > > Thanks, but why initialization matters her

[PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-07 Thread Yizhuo
In function sun8i_dwmac_set_syscon(), local variable "val" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used directly in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 7 ++-

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-07 Thread Maxime Ripard
On Wed, Feb 06, 2019 at 09:53:16PM -0800, Yizhuo Zhai wrote: > > > On Wed, Feb 6, 2019 at 9:52 PM Yizhuo Zhai wrote: > > > > Thanks, but why initialization matters here? Is performance the main > > concern? > > > > On Wed, Feb 6, 2019 at 8:17 PM David Miller wrote: > >> > >> From: Yizhuo > >>

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-06 Thread Yizhuo Zhai
Thanks, but why initialization matters here? Is performance the main concern? On Wed, Feb 6, 2019 at 9:52 PM Yizhuo Zhai wrote: > > Thanks, but why initialization matters here? Is performance the main concern? > > On Wed, Feb 6, 2019 at 8:17 PM David Miller wrote: >> >> From: Yizhuo >> Date: T

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-06 Thread David Miller
From: Yizhuo Date: Tue, 5 Feb 2019 14:15:59 -0800 > @@ -639,9 +639,14 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv > *priv) > struct sunxi_priv_data *gmac = priv->plat->bsp_priv; > struct device_node *node = priv->device->of_node; > int ret; > - u32 reg, val; >

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-06 Thread Maxime Ripard
Hi, On Tue, Feb 05, 2019 at 02:15:59PM -0800, Yizhuo wrote: > In function sun8i_dwmac_set_syscon(), local variable "val" could > be uninitialized if function regmap_read() returns -EINVAL. > However, it will be used directly in the if statement, which > is potentially unsafe. > > Signed-off-by: Y

[PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-05 Thread Yizhuo
In function sun8i_dwmac_set_syscon(), local variable "val" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used directly in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 9 +++