summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Kubavat <dkubavat@nvidia.com>2021-09-06 05:10:38 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2021-10-18 08:54:55 -0400
commit3477d4b47e8112357a1e21bea291f72ed897763b (patch)
tree90ea40577ba934962a95e50a4d19cbbba71067d5
parent85696c17b91a5e30a621ffa3ed71623559f46ab9 (diff)
capture: Added NULL check for buf_ctx
Added NULL check for capture->buf_ctx before using it in vi_capture_shutdown. Bug 200769105 Change-Id: Icf38a287054f0d264ed493d919dc06e1bfee8424 Signed-off-by: Devang Kubavat <dkubavat@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2589937 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Jerry Chang <jerchang@nvidia.com> Reviewed-by: Aditya Tomar <adtomar@nvidia.com> Reviewed-by: Anubhav Rai <arai@nvidia.com> Reviewed-by: Frank Chen <frankc@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: Jerry Chang <jerchang@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
-rw-r--r--drivers/media/platform/tegra/camera/vi/capture.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/tegra/camera/vi/capture.c b/drivers/media/platform/tegra/camera/vi/capture.c
index d1bc037d8..9b8f324d4 100644
--- a/drivers/media/platform/tegra/camera/vi/capture.c
+++ b/drivers/media/platform/tegra/camera/vi/capture.c
@@ -205,7 +205,9 @@ void vi_capture_shutdown(struct tegra_vi_channel *chan)
205 } 205 }
206 206
207 capture_common_unpin_memory(&capture->requests); 207 capture_common_unpin_memory(&capture->requests);
208 destroy_buffer_table(capture->buf_ctx); 208 if (capture->buf_ctx != NULL)
209 destroy_buffer_table(capture->buf_ctx);
210
209 vfree(capture->unpins_list); 211 vfree(capture->unpins_list);
210 capture->unpins_list = NULL; 212 capture->unpins_list = NULL;
211 } 213 }