From 1709a628dfc8983f7718e978676cafc3c0399a70 Mon Sep 17 00:00:00 2001 From: Henri Roosen Date: Mon, 8 Mar 2021 15:57:10 +0100 Subject: mkfs.ubifs: Fix runtime assertions when running without crypto Running mkfs.ubifs which was build without crypto triggered the following assertion: mkfs.ubifs: ubifs-utils/mkfs.ubifs/fscrypt.h:166: inherit_fscrypt_context: Assertion `0' failed. A previous commit-cc4c5e295f54 ("mkfs.ubifs: Enable support for building without crypto") added a check for an existing fscrypt context before calling functions inherit_fscrypt_context() and free_fscrypt_context(), however did not properly do this for each call to these functions. Fixes: cc4c5e295f54 ("mkfs.ubifs: Enable support for building without crypto") Signed-off-by: Henri Roosen Signed-off-by: David Oberhollenzer --- ubifs-utils/mkfs.ubifs/fscrypt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ubifs-utils/mkfs.ubifs/fscrypt.h b/ubifs-utils/mkfs.ubifs/fscrypt.h index 34b799c..ff3d326 100644 --- a/ubifs-utils/mkfs.ubifs/fscrypt.h +++ b/ubifs-utils/mkfs.ubifs/fscrypt.h @@ -131,7 +131,7 @@ static inline void free_fscrypt_context(struct fscrypt_context *fctx) { (void)fctx; - assert(0); + assert(!fctx); } static inline int encrypt_path(void **outbuf, void *data, unsigned int data_len, @@ -163,7 +163,7 @@ static inline struct fscrypt_context *inherit_fscrypt_context(struct fscrypt_con { (void)fctx; - assert(0); + assert(!fctx); return NULL; } #endif /* WITH_CRYPTO */ -- cgit v1.2.3