[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202208221817.t5uzfegL-lkp@intel.com>
Date: Mon, 22 Aug 2022 13:45:25 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: kbuild@...ts.01.org, Dmitry Safonov <dima@...sta.com>,
Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
linux-kernel@...r.kernel.org
Cc: lkp@...el.com, kbuild-all@...ts.01.org, netdev@...r.kernel.org,
Dmitry Safonov <dima@...sta.com>,
Andy Lutomirski <luto@...capital.net>,
Ard Biesheuvel <ardb@...nel.org>,
Bob Gilligan <gilligan@...sta.com>,
David Ahern <dsahern@...nel.org>,
Eric Biggers <ebiggers@...nel.org>,
Francesco Ruggeri <fruggeri@...sta.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Ivan Delalande <colona@...sta.com>,
Jakub Kicinski <kuba@...nel.org>,
Leonard Crestez <cdleonard@...il.com>,
Paolo Abeni <pabeni@...hat.com>,
Salam Noureddine <noureddine@...sta.com>,
Shuah Khan <skhan@...uxfoundation.org>,
linux-crypto@...r.kernel.org
Subject: Re: [PATCH 02/31] crypto_pool: Add crypto_pool_reserve_scratch()
Hi Dmitry,
url: https://github.com/intel-lab-lkp/linux/commits/Dmitry-Safonov/net-tcp-Add-TCP-AO-support/20220819-010628
base: e34cfee65ec891a319ce79797dda18083af33a76
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220822/202208221817.t5uzfegL-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
New smatch warnings:
crypto/crypto_pool.c:203 crypto_pool_alloc_ahash() error: uninitialized symbol 'err'.
vim +/err +203 crypto/crypto_pool.c
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 171 int crypto_pool_alloc_ahash(const char *alg)
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 172 {
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 173 unsigned int i;
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 174 int err;
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 175
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 176 /* slow-path */
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 177 mutex_lock(&cpool_mutex);
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 178 for (i = 0; i < last_allocated; i++) {
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 179 if (cpool[i].alg && !strcmp(cpool[i].alg, alg)) {
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 180 if (kref_read(&cpool[i].kref) > 0) {
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 181 kref_get(&cpool[i].kref);
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 182 goto out;
"err" not set. It was supposed to be set to zero at the start. But
better to say "ret = i;" here maybe?
Why is i unsigned? It leads to unsightly casts. Presumably some static
checker insists on this... :/
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 183 } else {
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 184 break;
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 185 }
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 186 }
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 187 }
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 188
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 189 for (i = 0; i < last_allocated; i++) {
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 190 if (!cpool[i].alg)
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 191 break;
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 192 }
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 193 if (i >= CPOOL_SIZE) {
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 194 err = -ENOSPC;
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 195 goto out;
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 196 }
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 197
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 198 err = __cpool_alloc_ahash(&cpool[i], alg);
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 199 if (!err && last_allocated <= i)
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 200 last_allocated++;
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 201 out:
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 202 mutex_unlock(&cpool_mutex);
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 @203 return err ?: (int)i;
f4c3873630fc8c4 Dmitry Safonov 2022-08-18 204 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists