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

Commit 6efa3feb authored by Darshan Kumsi Srinivasa's avatar Darshan Kumsi Srinivasa Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: ignore processing responses in invalid state



No need to process response messages from video hardware
after device went into invalid state. Processing responses
may result in use-after-free memory fault because client
might free all the resources after error.

Change-Id: I3bfb26e5aa52aba33b7b62cda7820dcbc5fe033f
Signed-off-by: default avatarDarshan Kumsi Srinivasa <darssr@codeaurora.org>
parent 0a07b6df
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3229,6 +3229,12 @@ static void venus_hfi_core_work_handler(struct work_struct *work)
		struct msm_vidc_cb_info *r = &device->response_pkt[i];
		dprintk(VIDC_DBG, "Processing response %d of %d, type %d\n",
			(i + 1), num_responses, r->response_type);
		if (!__core_in_valid_state(device)) {
			dprintk(VIDC_ERR,
				"Ignore responses from %d to %d as device is in invalid state",
				(i + 1), num_responses);
			break;
		}
		device->callback(r->response_type, &r->response);
	}