File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
drivers/net/ethernet/hisilicon/hns Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,6 @@ static int hnae_alloc_buffers(struct hnae_ring *ring)
150150/* free desc along with its attached buffer */
151151static void hnae_free_desc (struct hnae_ring * ring )
152152{
153- hnae_free_buffers (ring );
154153 dma_unmap_single (ring_to_dev (ring ), ring -> desc_dma_addr ,
155154 ring -> desc_num * sizeof (ring -> desc [0 ]),
156155 ring_to_dma_dir (ring ));
@@ -183,6 +182,9 @@ static int hnae_alloc_desc(struct hnae_ring *ring)
183182/* fini ring, also free the buffer for the ring */
184183static void hnae_fini_ring (struct hnae_ring * ring )
185184{
185+ if (is_rx_ring (ring ))
186+ hnae_free_buffers (ring );
187+
186188 hnae_free_desc (ring );
187189 kfree (ring -> desc_cb );
188190 ring -> desc_cb = NULL ;
You can’t perform that action at this time.
0 commit comments