diff options
author | Ishwarya Balaji Gururajan <igururajan@nvidia.com> | 2016-12-15 15:58:28 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-01-12 16:14:27 -0500 |
commit | 43b13ddbce690d825dbc242fdb5aa0df9c62eea4 (patch) | |
tree | 618dcba2e93ec19eda3e386347a749b2ea5c261c /drivers/video/tegra/dc/dsi.c | |
parent | f0eab82c3db2d087f3187d056dfceb28a903f53d (diff) |
tegra: dc: fix coverity RESOURCE_LEAK in dsi.c
fix resource leak to incorrect freeing before allocation
Coverity ID: 36307
Coverity ID: 36308
Coverity ID: 36310
Bug 200192413
Change-Id: I88528fc7b70939391d4c35bca09716f45e0947e9
Signed-off-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com>
Reviewed-on: http://git-master/r/1272168
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/dsi.c')
-rw-r--r-- | drivers/video/tegra/dc/dsi.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c index 0399fc91e..a3338364d 100644 --- a/drivers/video/tegra/dc/dsi.c +++ b/drivers/video/tegra/dc/dsi.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/video/tegra/dc/dsi.c | 2 | * drivers/video/tegra/dc/dsi.c |
3 | * | 3 | * |
4 | * Copyright (c) 2011-2016, NVIDIA CORPORATION, All rights reserved. | 4 | * Copyright (c) 2011-2017, NVIDIA CORPORATION, All rights reserved. |
5 | * | 5 | * |
6 | * This software is licensed under the terms of the GNU General Public | 6 | * This software is licensed under the terms of the GNU General Public |
7 | * License version 2, as published by the Free Software Foundation, and | 7 | * License version 2, as published by the Free Software Foundation, and |
@@ -2837,16 +2837,16 @@ static struct dsi_status *tegra_dsi_save_state_switch_to_host_cmd_mode( | |||
2837 | struct dsi_status *init_status = NULL; | 2837 | struct dsi_status *init_status = NULL; |
2838 | int err; | 2838 | int err; |
2839 | 2839 | ||
2840 | init_status = kzalloc(sizeof(*init_status), GFP_KERNEL); | ||
2841 | if (!init_status) | ||
2842 | return ERR_PTR(-ENOMEM); | ||
2843 | |||
2840 | if (dsi->status.init != DSI_MODULE_INIT || | 2844 | if (dsi->status.init != DSI_MODULE_INIT || |
2841 | dsi->status.lphs == DSI_LPHS_NOT_INIT) { | 2845 | dsi->status.lphs == DSI_LPHS_NOT_INIT) { |
2842 | err = -EPERM; | 2846 | err = -EPERM; |
2843 | goto fail; | 2847 | goto fail; |
2844 | } | 2848 | } |
2845 | 2849 | ||
2846 | init_status = kzalloc(sizeof(*init_status), GFP_KERNEL); | ||
2847 | if (!init_status) | ||
2848 | return ERR_PTR(-ENOMEM); | ||
2849 | |||
2850 | *init_status = dsi->status; | 2850 | *init_status = dsi->status; |
2851 | 2851 | ||
2852 | if (dsi->info.hs_cmd_mode_supported) { | 2852 | if (dsi->info.hs_cmd_mode_supported) { |