msm: ipa3: Send quota/BW monitor commands when uC event ring setup

When WLAN IPA offload was not enabled we are not setting up the uC event
ring, so we can't request to uC to Quota/BW motior command, it will result
into NULL pointer access. Adding changes to send quota/BW monitor commands
only when uC event ring setup.
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c b/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c
index 37a2916..291d0a3 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_uc.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
  * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
 #include "ipa_i.h"
@@ -1733,6 +1734,11 @@
 	struct ipa_mem_buffer cmd;
 	struct IpaQuotaMonitoring_t *quota_info;
 
+	if (!ipa3_ctx->uc_ctx.uc_event_ring_valid) {
+		IPADBG("uC event ring not configured, Quota monitor won't work\n");
+		return res;
+	}
+
 	cmd.size = sizeof(*quota_info);
 	cmd.base = dma_alloc_coherent(ipa3_ctx->uc_pdev, cmd.size,
 		&cmd.phys_base, GFP_KERNEL);
@@ -1801,6 +1807,11 @@
 	if (!info)
 		return -EINVAL;
 
+	if (!ipa3_ctx->uc_ctx.uc_event_ring_valid) {
+		IPADBG("uC event ring not configured, BW monitor won't work\n");
+		return res;
+	}
+
 	/* check max entry */
 	if (info->num > BW_MONITORING_MAX_THRESHOLD) {
 		IPAERR("%d, support max %d bw monitor\n", info->num,