misc:cryptodev: fix null_check coverity issue
Shravani Dingari [Fri, 15 May 2015 06:22:46 +0000 (11:22 +0530)]
Fix coverity issue of not returning when null_check
shows the memory allocated is NULL
Coverity id : 30087

Bug 1416640

Change-Id: Idfaa2968de6e4e4719bf0cc089267177a0a4f588
Signed-off-by: Shravani Dingari <shravanid@nvidia.com>
Reviewed-on: http://git-master/r/743120
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>

drivers/misc/tegra-cryptodev.c

index 3b1ea0f..44adc66 100644 (file)
@@ -93,7 +93,7 @@ static int tegra_crypto_dev_open(struct inode *inode, struct file *filp)
        ctx = kzalloc(sizeof(struct tegra_crypto_ctx), GFP_KERNEL);
        if (!ctx) {
                pr_err("no memory for context\n");
-               ret = -ENOMEM;
+               return -ENOMEM;
        }
 
        /* CBC tfm is allocated during device_open itself