Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58f94df2 authored by Dinesh K Garg's avatar Dinesh K Garg
Browse files

md: Set tfm NULL if crypto mode is not available



Currently, dm-req-crypt module destroys dm-req-crypt device if
crypto algorithm is not available. However, it does not set tfm to
NULL which is checked in destructor before releasing tfm. Adding a
NULL assignment to tfm so that destructor does not try to deallocate
tfm which was not allocated.

Change-Id: Id1bfcf45b7b1fe58db0147ec7c27aa585e8d970e
Signed-off-by: default avatarDinesh K Garg <dineshg@codeaurora.org>
parent 3380d16c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1193,6 +1193,7 @@ static int req_crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
		DMERR("%s ablkcipher tfm allocation failed : error\n",
					 __func__);
		err =  DM_REQ_CRYPT_ERROR;
		tfm = NULL;
		goto ctr_exit;
	}