Skip to content

Commit 9e6e8dd

Browse files
dwsuseigaw
authored andcommitted
linux: use ssize_t as return type for nvme_identity_len
The function returns also negative values, thus ssize_t is the correct type to use here. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 4cc727d commit 9e6e8dd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/nvme/linux.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,10 +1134,10 @@ static int derive_nvme_keys(const char *hostnqn, const char *subsysnqn,
11341134
psk, key_len);
11351135
}
11361136

1137-
static size_t nvme_identity_len(int hmac, int version, const char *hostnqn,
1138-
const char *subsysnqn)
1137+
static ssize_t nvme_identity_len(int hmac, int version, const char *hostnqn,
1138+
const char *subsysnqn)
11391139
{
1140-
size_t len;
1140+
ssize_t len;
11411141

11421142
if (!hostnqn || !subsysnqn) {
11431143
errno = EINVAL;
@@ -1162,7 +1162,7 @@ char *nvme_generate_tls_key_identity(const char *hostnqn, const char *subsysnqn,
11621162
{
11631163
_cleanup_free_ unsigned char *psk = NULL;
11641164
char *identity;
1165-
size_t identity_len;
1165+
ssize_t identity_len;
11661166
int ret = -1;
11671167

11681168
identity_len = nvme_identity_len(hmac, version, hostnqn, subsysnqn);
@@ -1345,7 +1345,7 @@ long nvme_insert_tls_key_versioned(const char *keyring, const char *key_type,
13451345
_cleanup_free_ unsigned char *psk = NULL;
13461346
_cleanup_free_ char *identity = NULL;
13471347
key_serial_t keyring_id, key;
1348-
size_t identity_len;
1348+
ssize_t identity_len;
13491349
int ret;
13501350

13511351
keyring_id = nvme_lookup_keyring(keyring);

0 commit comments

Comments
 (0)