Skip to content

Commit ada3bfb

Browse files
committed
Merge tag 'tpmdd-next-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd
Pull tpm updates from Jarkko Sakkinen: "Just a few bug fixes this time" * tag 'tpmdd-next-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle security/keys: Remove inconsistent __user annotation char: move from strlcpy with unused retval to strscpy
2 parents 3604a7f + 2d869f0 commit ada3bfb

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

drivers/char/tpm/tpm_ppi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ void tpm_add_ppi(struct tpm_chip *chip)
380380
TPM_PPI_FN_VERSION,
381381
NULL, ACPI_TYPE_STRING);
382382
if (obj) {
383-
strlcpy(chip->ppi_version, obj->string.pointer,
383+
strscpy(chip->ppi_version, obj->string.pointer,
384384
sizeof(chip->ppi_version));
385385
ACPI_FREE(obj);
386386
}

security/keys/keyring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static void keyring_revoke(struct key *keyring);
7979
static void keyring_destroy(struct key *keyring);
8080
static void keyring_describe(const struct key *keyring, struct seq_file *m);
8181
static long keyring_read(const struct key *keyring,
82-
char __user *buffer, size_t buflen);
82+
char *buffer, size_t buflen);
8383

8484
struct key_type key_type_keyring = {
8585
.name = "keyring",

tools/testing/selftests/tpm2/tpm2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,10 @@ def __init__(self, flags = 0):
371371
fcntl.fcntl(self.tpm, fcntl.F_SETFL, flags)
372372
self.tpm_poll = select.poll()
373373

374+
def __del__(self):
375+
if self.tpm:
376+
self.tpm.close()
377+
374378
def close(self):
375379
self.tpm.close()
376380

0 commit comments

Comments
 (0)