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

Commit e849a34a authored by Zhen Kong's avatar Zhen Kong
Browse files

crypto: msm: Fix a bug when writing xts du size



The break is missing in the switch-case branch of writing xts du size,
this leads to incorrect xts du size setting.

Change-Id: I288c3d30cc3d59eb28672be32aa57819971ca97f
Signed-off-by: default avatarZhen Kong <zkong@codeaurora.org>
parent 4ae4d503
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
/* Qualcomm Crypto Engine driver.
 *
 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -829,12 +829,15 @@ static int _ce_setup_cipher(struct qce_device *pce_dev, struct qce_req *creq,
			case QCRYPTO_CTX_XTS_DU_SIZE_512B:
				pce->data = min((unsigned int)QCE_SECTOR_SIZE,
						creq->cryptlen);
				break;
			case QCRYPTO_CTX_XTS_DU_SIZE_1KB:
				pce->data =
					min((unsigned int)QCE_SECTOR_SIZE * 2,
					creq->cryptlen);
				break;
			default:
				pce->data = creq->cryptlen;
				break;
			}
		}
		if (creq->mode !=  QCE_MODE_ECB) {
@@ -1617,15 +1620,18 @@ static int _ce_setup_cipher_direct(struct qce_device *pce_dev,
					min((uint32_t)QCE_SECTOR_SIZE,
					creq->cryptlen), pce_dev->iobase +
					CRYPTO_ENCR_XTS_DU_SIZE_REG);
				break;
			case QCRYPTO_CTX_XTS_DU_SIZE_1KB:
				writel_relaxed(
					min((uint32_t)(QCE_SECTOR_SIZE * 2),
					creq->cryptlen), pce_dev->iobase +
					CRYPTO_ENCR_XTS_DU_SIZE_REG);
				break;
			default:
				writel_relaxed(creq->cryptlen,
					pce_dev->iobase +
					CRYPTO_ENCR_XTS_DU_SIZE_REG);
				break;
			}
		}
		if (creq->mode !=  QCE_MODE_ECB) {