summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorSri Krishna chowdary <schowdary@nvidia.com>2012-09-18 18:11:22 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 00:48:23 -0700
commita40b7a40876b0932c8385aa629b870af9bcb316f (patch)
treef30205b90d7d0573b2b8ec88b4f8ce230bf69e14 /drivers/crypto
parent7640542a3e404b216de001875df12286fd0f34c4 (diff)
crypto: tegra-se: fix coverity issue
Add assignment after NULL check. Bug 1046331 Change-Id: Ib82f18b3119fb3333ce57494e854cdbc557f1acc Signed-off-by: Sri Krishna chowdary <schowdary@nvidia.com> Reviewed-on: http://git-master/r/133520 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Rebase-Id: R58e9be503f91761fd24cea6683edf3ab8265649f
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/tegra-se.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/crypto/tegra-se.c b/drivers/crypto/tegra-se.c
index 17a86d51ec3b..47419702b56f 100644
--- a/drivers/crypto/tegra-se.c
+++ b/drivers/crypto/tegra-se.c
@@ -4,7 +4,7 @@
*
* Support for Tegra Security Engine hardware crypto algorithms.
*
- * Copyright (c) 2011, NVIDIA Corporation.
+ * Copyright (c) 2011-2012, NVIDIA Corporation. 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 as published by
@@ -997,15 +997,17 @@ static int tegra_se_aes_setkey(struct crypto_ablkcipher *tfm,
const u8 *key, u32 keylen)
{
struct tegra_se_aes_context *ctx = crypto_ablkcipher_ctx(tfm);
- struct tegra_se_dev *se_dev = ctx->se_dev;
+ struct tegra_se_dev *se_dev = NULL;
struct tegra_se_slot *pslot;
u8 *pdata = (u8 *)key;
- if (!ctx) {
- dev_err(se_dev->dev, "invalid context");
+ if (!ctx || !ctx->se_dev) {
+ pr_err("invalid context or dev");
return -EINVAL;
}
+ se_dev = ctx->se_dev;
+
if ((keylen != TEGRA_SE_KEY_128_SIZE) &&
(keylen != TEGRA_SE_KEY_192_SIZE) &&
(keylen != TEGRA_SE_KEY_256_SIZE)) {