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

Commit e5b17068 authored by Mohammed Javid's avatar Mohammed Javid
Browse files

msm: ipa4: Fix to NULL pointer dereference



Accessing of the NULL pointer dereference causing the page fault issue.
Added check before accessing of NULL pointer to avoid NULL pointer
dereference.

Change-Id: I5e5bd6b418f305e785f3ec96af014494eebf1ffc
Acked-by: default avatarAshok Vuyyuru <avuyyuru@qti.qualcomm.com>
Signed-off-by: default avatarMohammed Javid <mjavid@codeaurora.org>
parent f6f026ce
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -1162,10 +1162,12 @@ static void ipa3_q6_clnt_svc_arrive(struct work_struct *work)

static void ipa3_q6_clnt_svc_exit(struct work_struct *work)
{
	if (ipa3_qmi_ctx != NULL) {
		ipa3_qmi_ctx->server_sq.sq_family = 0;
		ipa3_qmi_ctx->server_sq.sq_node = 0;
		ipa3_qmi_ctx->server_sq.sq_port = 0;
	}
}

static int ipa3_q6_clnt_svc_event_notify_svc_new(struct qmi_handle *qmi,
	struct qmi_service *service)
@@ -1174,10 +1176,11 @@ static int ipa3_q6_clnt_svc_event_notify_svc_new(struct qmi_handle *qmi,
		  service->service, service->version, service->instance,
		  service->node, service->port);

	if (ipa3_qmi_ctx != NULL) {
		ipa3_qmi_ctx->server_sq.sq_family = AF_QIPCRTR;
		ipa3_qmi_ctx->server_sq.sq_node = service->node;
		ipa3_qmi_ctx->server_sq.sq_port = service->port;

	}
	if (!workqueues_stopped) {
		queue_delayed_work(ipa_clnt_req_workqueue,
			&ipa3_work_svc_arrive, 0);
@@ -1315,8 +1318,10 @@ static void ipa3_qmi_service_init_worker(struct work_struct *work)

	/* start the QMI msg cache */
	ipa3_qmi_ctx = vzalloc(sizeof(*ipa3_qmi_ctx));
	if (!ipa3_qmi_ctx)
	if (!ipa3_qmi_ctx) {
		IPAWANERR("Failed to allocate the memory to ipa3_qmi_ctx\n");
		return;
	}

	ipa3_qmi_ctx->modem_cfg_emb_pipe_flt =
		ipa3_get_modem_cfg_emb_pipe_flt();