qcacmn: Add Null checks in CDP Layer
Part-2: Add Null checks for all the API's in CDP Layer. Change-Id: I8a4628f79880aff1212dee132016e8e48fe721fc CRs-Fixed: 2136173
This commit is contained in:

committed by
snandini

parent
aa62ae7615
commit
c4a6b8480b
@@ -40,59 +40,114 @@ static inline u_int16_t
|
||||
cdp_tx_desc_alloc_and_mark_for_mcast_clone(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, u_int16_t buf_count)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_desc_alloc_and_mark_for_mcast_clone)
|
||||
return soc->ops->me_ops->
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!soc->ops->me_ops ||
|
||||
!soc->ops->me_ops->tx_desc_alloc_and_mark_for_mcast_clone)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->
|
||||
tx_desc_alloc_and_mark_for_mcast_clone
|
||||
(pdev, buf_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline u_int16_t
|
||||
cdp_tx_desc_free_and_unmark_for_mcast_clone(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, u_int16_t buf_count)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_desc_free_and_unmark_for_mcast_clone)
|
||||
return soc->ops->me_ops->
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!soc->ops->me_ops ||
|
||||
!soc->ops->me_ops->tx_desc_free_and_unmark_for_mcast_clone)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->
|
||||
tx_desc_free_and_unmark_for_mcast_clone
|
||||
(pdev, buf_count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline u_int16_t
|
||||
cdp_tx_get_mcast_buf_allocated_marked(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_get_mcast_buf_allocated_marked)
|
||||
return soc->ops->me_ops->tx_get_mcast_buf_allocated_marked
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!soc->ops->me_ops ||
|
||||
!soc->ops->me_ops->tx_get_mcast_buf_allocated_marked)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->tx_get_mcast_buf_allocated_marked
|
||||
(pdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_me_alloc_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_me_alloc_descriptor)
|
||||
return soc->ops->me_ops->tx_me_alloc_descriptor(pdev);
|
||||
return;
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!soc->ops->me_ops ||
|
||||
!soc->ops->me_ops->tx_me_alloc_descriptor)
|
||||
return;
|
||||
|
||||
soc->ops->me_ops->tx_me_alloc_descriptor(pdev);
|
||||
}
|
||||
|
||||
static inline void
|
||||
cdp_tx_me_free_descriptor(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_me_free_descriptor)
|
||||
return soc->ops->me_ops->tx_me_free_descriptor(pdev);
|
||||
return;
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!soc->ops->me_ops ||
|
||||
!soc->ops->me_ops->tx_me_free_descriptor)
|
||||
return;
|
||||
|
||||
soc->ops->me_ops->tx_me_free_descriptor(pdev);
|
||||
}
|
||||
|
||||
static inline uint16_t
|
||||
cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
qdf_nbuf_t wbuf, u_int8_t newmac[][6], uint8_t newmaccnt)
|
||||
{
|
||||
if (soc->ops->me_ops->tx_me_convert_ucast)
|
||||
return soc->ops->me_ops->tx_me_convert_ucast
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!soc->ops->me_ops ||
|
||||
!soc->ops->me_ops->tx_me_convert_ucast)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->tx_me_convert_ucast
|
||||
(vdev, wbuf, newmac, newmaccnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Should be a function pointer in ol_txrx_osif_ops{} */
|
||||
/**
|
||||
* @brief notify mcast frame indication from FW.
|
||||
@@ -108,8 +163,17 @@ cdp_tx_me_convert_ucast(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
static inline int cdp_mcast_notify(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, u_int8_t vdev_id, qdf_nbuf_t msdu)
|
||||
{
|
||||
if (soc->ops->me_ops->mcast_notify)
|
||||
return soc->ops->me_ops->mcast_notify(pdev, vdev_id, msdu);
|
||||
return 0;
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance", __func__);
|
||||
QDF_BUG(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!soc->ops->me_ops ||
|
||||
!soc->ops->me_ops->mcast_notify)
|
||||
return 0;
|
||||
|
||||
return soc->ops->me_ops->mcast_notify(pdev, vdev_id, msdu);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user