Эх сурвалжийг харах

qcacmn: Fix the crash when execute hal_rx_tlv_l3_type_get()

This function fails to register in the 6750 platform.
Since some old chips do not have l3 type field, the
callback function cannot be registered, so this change
solves it by recognizing whether the callback is NULL.
If it is NULL, then return an invalid vallue: 0xFFFF.

Change-Id: I47c8df5e54eeac9489010e45057e44eccdb2bf22
CRs-Fixed: 3258200
jinbaoliu 2 жил өмнө
parent
commit
5731d1c389
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      hal/wifi3.0/hal_rx.h

+ 4 - 1
hal/wifi3.0/hal_rx.h

@@ -31,6 +31,7 @@
 #define HAL_RX_OFFSET(block, field) block##_##field##_OFFSET
 #define HAL_RX_LSB(block, field) block##_##field##_LSB
 #define HAL_RX_MASK(block, field) block##_##field##_MASK
+#define HAL_RX_TLV_L3_TYPE_INVALID 0xFFFF
 
 #define HAL_RX_GET(_ptr, block, field) \
 	(((*((volatile uint32_t *)_ptr + (HAL_RX_OFFSET(block, field)>>2))) & \
@@ -3011,6 +3012,8 @@ hal_rx_tlv_l3_type_get(hal_soc_handle_t hal_soc_hdl, uint8_t *buf)
 {
 	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
 
-	return hal_soc->ops->hal_rx_tlv_l3_type_get(buf);
+	return hal_soc->ops->hal_rx_tlv_l3_type_get ?
+		hal_soc->ops->hal_rx_tlv_l3_type_get(buf) :
+			HAL_RX_TLV_L3_TYPE_INVALID;
 }
 #endif /* _HAL_RX_H */