Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 611ad28f authored by Neeti Desai's avatar Neeti Desai
Browse files

msm: ocmem: Update error handling in function __sched_grow



When zone allocation fails, no region has been created. Thus
the label "internal_error" should not call destroy_region. When
create_region fails, region is NULL, thus calling destroy_region
will result in NULL pointer dereferencing.

Change-Id: Ic30fc4f6bda64e85b395f5a3a8c24b66ced6e86c
Signed-off-by: default avatarNeeti Desai <neetid@codeaurora.org>
parent 5aeba531
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -768,7 +768,7 @@ retry_next_step:
			region = create_region();
			if (!region) {
				pr_err("ocmem: Unable to create region\n");
				goto region_error;
				goto internal_error;
			}
		}

@@ -851,8 +851,8 @@ region_error:
	detach_req(region, req);
	update_region_prio(region);
	/* req is going to be destroyed by the caller anyways */
internal_error:
	destroy_region(region);
internal_error:
invalid_op_error:
	return OP_FAIL;
}