diff --git a/dp/wifi3.0/dp_rx.h b/dp/wifi3.0/dp_rx.h index 99cd9ba0d227..e34552024a4e 100644 --- a/dp/wifi3.0/dp_rx.h +++ b/dp/wifi3.0/dp_rx.h @@ -803,10 +803,17 @@ static inline QDF_STATUS dp_rx_defrag_concat(qdf_nbuf_t dst, qdf_nbuf_t src) * (This is needed, because the headroom of the dst buffer * contains the rx desc.) */ - if (qdf_nbuf_cat(dst, src)) - return QDF_STATUS_E_DEFRAG_ERROR; + if (!qdf_nbuf_cat(dst, src)) { + /* + * qdf_nbuf_cat does not free the src memory. + * Free src nbuf before returning + * For failure case the caller takes of freeing the nbuf + */ + qdf_nbuf_free(src); + return QDF_STATUS_SUCCESS; + } - return QDF_STATUS_SUCCESS; + return QDF_STATUS_E_DEFRAG_ERROR; } /*