We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57a8837 commit 10e5ab1Copy full SHA for 10e5ab1
lib/tcrypt/tcrypt.c
@@ -928,14 +928,16 @@ int TCRYPT_activate(struct crypt_device *cd,
928
929
static bool is_tcrypt_subdev(const char *dm_uuid, const char *base_uuid)
930
{
931
+ const char *base_uuid_name;
932
+
933
assert(base_uuid);
934
+ base_uuid_name = strchr(base_uuid, '-');
935
- if (!dm_uuid)
936
+ if (!dm_uuid || !base_uuid_name)
937
return false;
938
939
if (!strncmp(dm_uuid, "SUBDEV-", 7))
- /* dm_uuid + 6 because function requires dm_uuid to contain '-' */
- return !dm_uuid_cmp(dm_uuid + 6, strchr(base_uuid, '-'));
940
+ return !strncmp(dm_uuid + 6, base_uuid_name, strlen(base_uuid_name));
941
942
/*
943
* FIXME: Drop after shift to dependency based deactivation (CRYPT_SUBDEV)
0 commit comments