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

Commit f8301029 authored by Dinesh K Garg's avatar Dinesh K Garg
Browse files

md: fix KW errors



dm-req-crypt is using WARN_ON macro at several places. Using WARN_ON
macro lets code to continue despite detecting an issue. This make
KW unhappy. So return after WARN_ON.

Change-Id: I5a404bb26f89da2a00ecc2dfbd9b2eecc6ba9032
Signed-off-by: default avatarDinesh K Garg <dineshg@codeaurora.org>
parent 37d3257d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -217,6 +217,7 @@ static void req_crypt_dec_pending_encrypt(struct req_dm_crypt_io *io)
			 * this should never happen
			 */
			WARN_ON(1);
			return;
		}
	} else {
		DMERR("%s io is NULL\n", __func__);
@@ -225,6 +226,7 @@ static void req_crypt_dec_pending_encrypt(struct req_dm_crypt_io *io)
		 * this should never happen
		 */
		WARN_ON(1);
		return;
	}

	atomic_dec(&io->pending);
@@ -253,6 +255,7 @@ static void req_crypt_dec_pending_decrypt(struct req_dm_crypt_io *io)
			 * this should never happen
			 */
			WARN_ON(1);
			return;
		}
	} else {
		DMERR("%s io is NULL\n",
@@ -262,6 +265,7 @@ static void req_crypt_dec_pending_decrypt(struct req_dm_crypt_io *io)
		 * this should never happen
		 */
		WARN_ON(1);
		return;
	}

	/* Should never get here if io or Clone is NULL */
@@ -445,6 +449,7 @@ static void req_cryptd_crypt_read_plain(struct req_dm_crypt_io *io)
	if (!io || !io->cloned_request) {
		DMERR("%s io is invalid\n", __func__);
		WARN_ON(1); /* should not happen */
		return;
	}

	clone = io->cloned_request;
@@ -696,6 +701,7 @@ static void req_cryptd_crypt_write_plain(struct req_dm_crypt_io *io)
	if (!io || !io->cloned_request) {
		DMERR("%s io is invalid\n", __func__);
		WARN_ON(1); /* should not happen */
		return;
	}

	clone = io->cloned_request;
@@ -740,6 +746,7 @@ static void req_cryptd_split_req_queue_cb(struct work_struct *work)
		err = DM_REQ_CRYPT_ERROR;
		/* If io is not populated this should not be called */
		WARN_ON(1);
		return;
	}
	req = skcipher_request_alloc(tfm, GFP_KERNEL);
	if (!req) {