Clarify clean up path of empty dm_target structure.

This commit is contained in:
Ondrej Kozina
2022-04-22 13:01:13 +02:00
committed by Milan Broz
parent f391f4baf1
commit 5a8b95aa45
2 changed files with 4 additions and 1 deletions

View File

@@ -1597,6 +1597,9 @@ static void _dm_target_free_query_path(struct crypt_device *cd, struct dm_target
static void _dm_target_erase(struct crypt_device *cd, struct dm_target *tgt)
{
if (tgt->direction == TARGET_EMPTY)
return;
if (tgt->direction == TARGET_QUERY)
_dm_target_free_query_path(cd, tgt);

View File

@@ -77,7 +77,7 @@ static inline uint32_t act2dmflags(uint32_t act_flags)
#define DM_INTEGRITY_RESET_RECALC_SUPPORTED (1 << 27) /* dm-integrity automatic recalculation supported */
typedef enum { DM_CRYPT = 0, DM_VERITY, DM_INTEGRITY, DM_LINEAR, DM_ERROR, DM_ZERO, DM_UNKNOWN } dm_target_type;
enum tdirection { TARGET_SET = 1, TARGET_QUERY };
enum tdirection { TARGET_EMPTY = 0, TARGET_SET, TARGET_QUERY };
int dm_flags(struct crypt_device *cd, dm_target_type target, uint32_t *flags);