]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
bnx2x: Fix move FP memory deallocations
[karo-tx-linux.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_cmn.c
index f2d1ff10054b28ccaa9b7baddfa408821c7409af..26b4dfcc00872b615d79b1489d0c1495eb3b8ad4 100644 (file)
@@ -53,6 +53,7 @@ static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to)
        struct bnx2x_fp_stats *to_fp_stats = &bp->fp_stats[to];
        int old_max_eth_txqs, new_max_eth_txqs;
        int old_txdata_index = 0, new_txdata_index = 0;
+       struct bnx2x_agg_info *old_tpa_info = to_fp->tpa_info;
 
        /* Copy the NAPI object as it has been already initialized */
        from_fp->napi = to_fp->napi;
@@ -61,6 +62,11 @@ static inline void bnx2x_move_fp(struct bnx2x *bp, int from, int to)
        memcpy(to_fp, from_fp, sizeof(*to_fp));
        to_fp->index = to;
 
+       /* Retain the tpa_info of the original `to' version as we don't want
+        * 2 FPs to contain the same tpa_info pointer.
+        */
+       to_fp->tpa_info = old_tpa_info;
+
        /* move sp_objs contents as well, as their indices match fp ones */
        memcpy(to_sp_objs, from_sp_objs, sizeof(*to_sp_objs));