lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ced576c2-11a3-3fbf-0fdf-4620a442cadf@canonical.com>
Date:   Fri, 12 Mar 2021 09:25:03 +0000
From:   Colin Ian King <colin.king@...onical.com>
To:     Michal Simek <michal.simek@...inx.com>,
        linux-kernel@...r.kernel.org, monstr@...str.eu, git@...inx.com,
        Linus Walleij <linus.walleij@...aro.org>
Cc:     dan.carpenter@...cle.com, linux-gpio@...r.kernel.org
Subject: Re: [PATCH] pinctrl: core: Set ret to 0 when group is skipped

On 12/03/2021 07:31, Michal Simek wrote:
> Static analyzer tool found that the ret variable is not initialized but
> code expects ret value >=0 when pinconf is skipped in the first pinmux
> loop. The same expectation is for pinmux in a pinconf loop.
> That's why initialize ret to 0 to avoid uninitialized ret value in first
> loop or reusing ret value from first loop in second.
> 
> Addresses-Coverity: ("Uninitialized variables")
> Signed-off-by: Michal Simek <michal.simek@...inx.com>
> CC: Colin Ian King <colin.king@...onical.com>
> CC: Dan Carpenter <dan.carpenter@...cle.com>
> ---
> 
>  drivers/pinctrl/core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> index f5c32d2a3c91..136c323d855e 100644
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -1266,6 +1266,7 @@ static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state)
>  			break;
>  		case PIN_MAP_TYPE_CONFIGS_PIN:
>  		case PIN_MAP_TYPE_CONFIGS_GROUP:
> +			ret = 0;
>  			break;
>  		default:
>  			ret = -EINVAL;
> @@ -1284,6 +1285,7 @@ static int pinctrl_commit_state(struct pinctrl *p, struct pinctrl_state *state)
>  	list_for_each_entry(setting, &state->settings, node) {
>  		switch (setting->type) {
>  		case PIN_MAP_TYPE_MUX_GROUP:
> +			ret = 0;
>  			break;
>  		case PIN_MAP_TYPE_CONFIGS_PIN:
>  		case PIN_MAP_TYPE_CONFIGS_GROUP:
> 

Thanks Michal,

Reviewed-by: Colin Ian King <colin.king@...onical.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ