From 1155e394a1b152cf2ee85a126d6a3b15db1b7a5d Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Fri, 13 Sep 2019 10:28:02 -0700 Subject: [PATCH] gpu: nvgpu: return error for allocation failure This patch modifies nvgpu_runlist_setup_sw() to return error code for allocation failures. This patch also modifies nvgpu_runlist_cleanup_sw() to check active_runlist_info pointer before freeing runlist->mem. Jira NVGPU-3699 Change-Id: Id6e72188ae5e921568c7ad016c115676358edf58 Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/2197346 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/runlist.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/fifo/runlist.c b/drivers/gpu/nvgpu/common/fifo/runlist.c index f188af857..c9661aa29 100644 --- a/drivers/gpu/nvgpu/common/fifo/runlist.c +++ b/drivers/gpu/nvgpu/common/fifo/runlist.c @@ -642,7 +642,8 @@ void nvgpu_runlist_cleanup_sw(struct gk20a *g) u32 i, j; struct nvgpu_runlist_info *runlist; - if ((f == NULL) || (f->runlist_info == NULL)) { + if ((f == NULL) || (f->runlist_info == NULL) || + (f->active_runlist_info == NULL)) { return; }