Przeglądaj źródła

techpack: ipa: Fixing compile errors

Addressed NULL check and P1 errors and fixing them accordingly.

Change-Id: I1a7e03fad2bd54d4c035a783f16709be12cd5be8
Signed-off-by: Michael Adisumarta <[email protected]>
Michael Adisumarta 4 lat temu
rodzic
commit
f4ea405fa9

+ 3 - 2
drivers/platform/msm/ipa/ipa_clients/ipa_mhi_client.c

@@ -178,8 +178,9 @@ static int ipa_mhi_read_write_host(enum ipa_mhi_dma_dir dir, void *dev_addr,
 		host_addr = IPA_MHI_CLIENT_HOST_ADDR_COND(host_addr);
 
 		mem.size = size;
-		mem.base = dma_alloc_coherent(pdev, mem.size,
-			&mem.phys_base, GFP_KERNEL);
+		if (pdev)
+			mem.base = dma_alloc_coherent(pdev, mem.size,
+				&mem.phys_base, GFP_KERNEL);
 		if (!mem.base) {
 			IPA_MHI_ERR(
 				"dma_alloc_coherent failed, DMA buff size %d\n"

+ 2 - 2
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

@@ -4648,8 +4648,8 @@ static void ipa_dma_gsi_irq_rx_notify_cb(struct gsi_chan_xfer_notify *notify)
 int ipa3_alloc_common_event_ring(void)
 {
 	struct gsi_evt_ring_props gsi_evt_ring_props;
-	dma_addr_t evt_dma_addr;
-	dma_addr_t evt_rp_dma_addr;
+	dma_addr_t evt_dma_addr = 0;
+	dma_addr_t evt_rp_dma_addr = 0;
 	int result;
 
 	memset(&gsi_evt_ring_props, 0, sizeof(gsi_evt_ring_props));

+ 4 - 3
drivers/platform/msm/ipa/ipa_v3/ipa_uc.c

@@ -1088,15 +1088,16 @@ int ipa3_uc_interface_init(void)
 		if (!ipa_uc_holb_wq) {
 			IPAERR("Failed to create ipa_uc_holb_wq\n");
 			result = -EFAULT;
-			goto fail_wq;
+			goto irq_fail3;
 		}
 	}
 	ipa3_ctx->uc_ctx.uc_inited = true;
 
 	IPADBG("IPA uC interface is initialized\n");
 	return 0;
-fail_wq:
-	destroy_workqueue(ipa_uc_holb_wq);
+
+irq_fail3:
+	ipa3_remove_interrupt_handler(IPA_UC_IRQ_2);
 irq_fail2:
 	ipa3_remove_interrupt_handler(IPA_UC_IRQ_1);
 irq_fail1:

+ 1 - 1
drivers/platform/msm/ipa/ipa_v3/ipa_uc_holb_monitor.c

@@ -186,7 +186,7 @@ int ipa3_uc_client_del_holb_monitor(uint16_t gsi_ch, uint8_t ee)
 	client_idx = ipa3_get_holb_client_idx_by_ch(gsi_ch);
 	if (client_idx == -EINVAL) {
 		IPAERR("Invalid client with GSI chan %d\n", gsi_ch);
-		ret = client_idx;
+		return client_idx;
 	}
 
 	holb_client = &(ipa3_ctx->uc_ctx.holb_monitor.client[client_idx]);

+ 2 - 1
drivers/platform/msm/ipa/ipa_v3/rmnet_ctl_ipa.c

@@ -514,7 +514,8 @@ static void rmnet_ctl_wakeup_ipa(struct work_struct *work)
 	/* dequeue the skb */
 	while (skb_queue_len(&rmnet_ctl_ipa3_ctx->tx_queue) > 0) {
 		skb = skb_dequeue(&rmnet_ctl_ipa3_ctx->tx_queue);
-		len = skb->len;
+		if (skb)
+			len = skb->len;
 		spin_unlock_irqrestore(&rmnet_ctl_ipa3_ctx->tx_lock, flags);
 		/*
 		 * both data packets and command will be routed to