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

Commit f64c5bbc authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Fix handling of ocmem_notifier_register() return value



The ocmem driver might return -EPROBE_DEFER (or any other error)
as a ERR_PTR.  These shouldn't be construed as a valid handle.

Change-Id: Ife5a7e6aaef4f8d9aff3c149cc15e10ce11a4af4
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
CRs-Fixed: 565882
parent 4bb26321
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3070,9 +3070,10 @@ static void venus_hfi_ocmem_init(struct venus_hfi_device *device)
	ocmem->vidc_ocmem_nb.notifier_call = venus_hfi_ocmem_notify_handler;
	ocmem->handle =
		ocmem_notifier_register(OCMEM_VIDEO, &ocmem->vidc_ocmem_nb);
	if (!ocmem->handle) {
		dprintk(VIDC_WARN, "Failed to register OCMEM notifier.");
		dprintk(VIDC_INFO, " Performance will be impacted\n");
	if (IS_ERR_OR_NULL(ocmem->handle)) {
		dprintk(VIDC_WARN,
				"Failed to register OCMEM notifier. Performance might be impacted\n");
		ocmem->handle = NULL;
	}
}