diff options
| author | Achal Verma <achalv@nvidia.com> | 2021-01-27 01:13:13 -0500 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2021-03-30 16:41:56 -0400 |
| commit | 699508e9dc6f39c963ccc7ee8b4e816bcee455cc (patch) | |
| tree | 3644a74aa692378350fc12aea1b9635671a24933 /drivers/crypto | |
| parent | 63296a87b5095de636067c54fb96c51c51341fb5 (diff) | |
vse: Fix null pointer dereference.
Fix null pointer dereferencing in an error print
before pointer is assigned to non null value.
This fix coverity issue: 2448554
Bug 200689436
Change-Id: If85e16d50d7286b3fa67d2d9a7162b22fe048616
Signed-off-by: Achal Verma <achalv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2475949
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Dmitry Pervushin <dpervushin@nvidia.com>
Reviewed-by: Rahul Jain (SW-TEGRA) <rahuljain@nvidia.com>
Tested-by: Smriti Sharma <smritis@nvidia.com>
GVS: Gerrit_Virtual_Submit
(cherry picked from commit 559dc2257bc22855010b690f31272e321deeda73)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2499890
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Phoenix Jung <pjung@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/crypto')
| -rw-r--r-- | drivers/crypto/tegra-hv-vse.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/crypto/tegra-hv-vse.c b/drivers/crypto/tegra-hv-vse.c index 7629f26fe..861d0aa83 100644 --- a/drivers/crypto/tegra-hv-vse.c +++ b/drivers/crypto/tegra-hv-vse.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | * | 4 | * |
| 5 | * Support for Tegra Virtual Security Engine hardware crypto algorithms. | 5 | * Support for Tegra Virtual Security Engine hardware crypto algorithms. |
| 6 | * | 6 | * |
| 7 | * Copyright (c) 2016-2020, NVIDIA Corporation. All Rights Reserved. | 7 | * Copyright (c) 2016-2021, NVIDIA Corporation. All Rights Reserved. |
| 8 | * | 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
| @@ -3653,16 +3653,11 @@ static int tegra_vse_kthread(void *unused) | |||
| 3653 | read_size = tegra_hv_ivc_read(pivck, | 3653 | read_size = tegra_hv_ivc_read(pivck, |
| 3654 | ivc_resp_msg, | 3654 | ivc_resp_msg, |
| 3655 | sizeof(struct tegra_virtual_se_ivc_msg_t)); | 3655 | sizeof(struct tegra_virtual_se_ivc_msg_t)); |
| 3656 | if (read_size <= 0) { | 3656 | if (read_size < sizeof(struct tegra_virtual_se_ivc_msg_t) ) { |
| 3657 | dev_err(se_dev->dev, | 3657 | pr_err("tegra_hv_ivc_read returned error %d\n", read_size); |
| 3658 | "tegra_hv_ivc_read returned error %d\n", read_size); | ||
| 3659 | break; | 3658 | break; |
| 3660 | } | 3659 | } |
| 3661 | if (read_size < sizeof(struct tegra_virtual_se_ivc_msg_t)) { | 3660 | |
| 3662 | dev_err(se_dev->dev, | ||
| 3663 | "Wrong read msg len %d\n", read_size); | ||
| 3664 | continue; | ||
| 3665 | } | ||
| 3666 | p_dat = | 3661 | p_dat = |
| 3667 | (struct tegra_vse_tag *)ivc_resp_msg->hdr.tag; | 3662 | (struct tegra_vse_tag *)ivc_resp_msg->hdr.tag; |
| 3668 | priv = (struct tegra_vse_priv_data *)p_dat->priv_data; | 3663 | priv = (struct tegra_vse_priv_data *)p_dat->priv_data; |
