* [jarkko-tpmdd:queue 12/15] drivers/char/tpm/tpm2-sessions.c:261:27: warning: unused variable 'auth'
@ 2026-01-26 0:53 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-01-26 0:53 UTC (permalink / raw)
To: Jarkko Sakkinen; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git queue
head: fbd9af022416579062d59e206c7f71890d27fc31
commit: 67a0e52127ec9057ddcb47bca6cd267f2a3d20a7 [12/15] tpm2-sessions: Remove the support for more than one authorization
config: sparc-randconfig-002-20260126 (https://download.01.org/0day-ci/archive/20260126/202601260825.EMdrikNe-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260126/202601260825.EMdrikNe-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601260825.EMdrikNe-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/char/tpm/tpm2-sessions.c: In function 'tpm_buf_append_name':
>> drivers/char/tpm/tpm2-sessions.c:261:27: warning: unused variable 'auth' [-Wunused-variable]
261 | struct tpm2_auth *auth;
| ^~~~
vim +/auth +261 drivers/char/tpm/tpm2-sessions.c
a61809a3323982 Jarkko Sakkinen 2024-07-03 231
a61809a3323982 Jarkko Sakkinen 2024-07-03 232 /**
7895041508233a Jarkko Sakkinen 2025-12-03 233 * tpm_buf_append_name() - Append a handle and store TPM name
7895041508233a Jarkko Sakkinen 2025-12-03 234 * @chip: TPM chip to use.
7895041508233a Jarkko Sakkinen 2025-12-03 235 * @buf: TPM buffer containing the TPM command in-transit.
7895041508233a Jarkko Sakkinen 2025-12-03 236 * @handle: TPM handle to be appended.
7895041508233a Jarkko Sakkinen 2025-12-03 237 * @name: TPM name of the handle
7895041508233a Jarkko Sakkinen 2025-12-03 238 * @name_size: Size of the TPM name.
a61809a3323982 Jarkko Sakkinen 2024-07-03 239 *
a61809a3323982 Jarkko Sakkinen 2024-07-03 240 * In order to compute session HMACs, we need to know the names of the
a61809a3323982 Jarkko Sakkinen 2024-07-03 241 * objects pointed to by the handles. For most objects, this is simply
a61809a3323982 Jarkko Sakkinen 2024-07-03 242 * the actual 4 byte handle or an empty buf (in these cases @name
a61809a3323982 Jarkko Sakkinen 2024-07-03 243 * should be NULL) but for volatile objects, permanent objects and NV
a61809a3323982 Jarkko Sakkinen 2024-07-03 244 * areas, the name is defined as the hash (according to the name
a61809a3323982 Jarkko Sakkinen 2024-07-03 245 * algorithm which should be set to sha256) of the public area to
a61809a3323982 Jarkko Sakkinen 2024-07-03 246 * which the two byte algorithm id has been appended. For these
a61809a3323982 Jarkko Sakkinen 2024-07-03 247 * objects, the @name pointer should point to this. If a name is
a61809a3323982 Jarkko Sakkinen 2024-07-03 248 * required but @name is NULL, then TPM2_ReadPublic() will be called
a61809a3323982 Jarkko Sakkinen 2024-07-03 249 * on the handle to obtain the name.
a61809a3323982 Jarkko Sakkinen 2024-07-03 250 *
a61809a3323982 Jarkko Sakkinen 2024-07-03 251 * As with most tpm_buf operations, success is assumed because failure
a61809a3323982 Jarkko Sakkinen 2024-07-03 252 * will be caused by an incorrect programming model and indicated by a
a61809a3323982 Jarkko Sakkinen 2024-07-03 253 * kernel message.
6e9722e9a7bfe1 Jarkko Sakkinen 2025-11-30 254 *
7895041508233a Jarkko Sakkinen 2025-12-03 255 * Returns zero on success.
7895041508233a Jarkko Sakkinen 2025-12-03 256 * Returns -EIO when the authorization area state is malformed.
a61809a3323982 Jarkko Sakkinen 2024-07-03 257 */
6e9722e9a7bfe1 Jarkko Sakkinen 2025-11-30 258 int tpm_buf_append_name(struct tpm_chip *chip, struct tpm_buf *buf,
7895041508233a Jarkko Sakkinen 2025-12-03 259 u32 handle, u8 *name, u16 name_size)
a61809a3323982 Jarkko Sakkinen 2024-07-03 260 {
a61809a3323982 Jarkko Sakkinen 2024-07-03 @261 struct tpm2_auth *auth;
6e9722e9a7bfe1 Jarkko Sakkinen 2025-11-30 262 int ret;
67a0e52127ec90 Jarkko Sakkinen 2025-12-08 263
67a0e52127ec90 Jarkko Sakkinen 2025-12-08 264 if (tpm_buf_length(buf) != TPM_HEADER_SIZE) {
67a0e52127ec90 Jarkko Sakkinen 2025-12-08 265 dev_err(&chip->dev, "too many handles\n");
67a0e52127ec90 Jarkko Sakkinen 2025-12-08 266 ret = -EIO;
67a0e52127ec90 Jarkko Sakkinen 2025-12-08 267 goto err;
67a0e52127ec90 Jarkko Sakkinen 2025-12-08 268 }
a61809a3323982 Jarkko Sakkinen 2024-07-03 269
a61809a3323982 Jarkko Sakkinen 2024-07-03 270 if (!tpm2_chip_auth(chip)) {
27184f8905ba68 Jarkko Sakkinen 2024-11-13 271 tpm_buf_append_handle(chip, buf, handle);
6e9722e9a7bfe1 Jarkko Sakkinen 2025-11-30 272 return 0;
a61809a3323982 Jarkko Sakkinen 2024-07-03 273 }
a61809a3323982 Jarkko Sakkinen 2024-07-03 274
:::::: The code at line 261 was first introduced by commit
:::::: a61809a33239821d70eba77bd0d6d13c29bbad0d tpm: Address !chip->auth in tpm_buf_append_name()
:::::: TO: Jarkko Sakkinen <jarkko@kernel.org>
:::::: CC: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-26 0:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 0:53 [jarkko-tpmdd:queue 12/15] drivers/char/tpm/tpm2-sessions.c:261:27: warning: unused variable 'auth' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.