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)
150
150
/* free desc along with its attached buffer */
151
151
static void hnae_free_desc (struct hnae_ring * ring )
152
152
{
153
- hnae_free_buffers (ring );
154
153
dma_unmap_single (ring_to_dev (ring ), ring -> desc_dma_addr ,
155
154
ring -> desc_num * sizeof (ring -> desc [0 ]),
156
155
ring_to_dma_dir (ring ));
@@ -183,6 +182,9 @@ static int hnae_alloc_desc(struct hnae_ring *ring)
183
182
/* fini ring, also free the buffer for the ring */
184
183
static void hnae_fini_ring (struct hnae_ring * ring )
185
184
{
185
+ if (is_rx_ring (ring ))
186
+ hnae_free_buffers (ring );
187
+
186
188
hnae_free_desc (ring );
187
189
kfree (ring -> desc_cb );
188
190
ring -> desc_cb = NULL ;
You can’t perform that action at this time.
0 commit comments