Skip to content

Commit b49bd37

Browse files
danielj-mellanoxkuba-moo
authored andcommitted
virtio_net: Fix memory leak in virtnet_rx_mod_work
The pointer delcaration was missing the __free(kfree). Fixes: ff7c7d9 ("virtio_net: Remove command data from control_buf") Reported-by: Jens Axboe <[email protected]> Closes: https://lore.kernel.org/netdev/[email protected]/ Signed-off-by: Daniel Jurgens <[email protected]> Tested-by: Jens Axboe <[email protected]> Reviewed-by: Xuan Zhuo <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3815553 commit b49bd37

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/virtio_net.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2862,7 +2862,6 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs)
28622862

28632863
static int virtnet_close(struct net_device *dev)
28642864
{
2865-
u8 *promisc_allmulti __free(kfree) = NULL;
28662865
struct virtnet_info *vi = netdev_priv(dev);
28672866
int i;
28682867

@@ -2883,11 +2882,11 @@ static void virtnet_rx_mode_work(struct work_struct *work)
28832882
{
28842883
struct virtnet_info *vi =
28852884
container_of(work, struct virtnet_info, rx_mode_work);
2885+
u8 *promisc_allmulti __free(kfree) = NULL;
28862886
struct net_device *dev = vi->dev;
28872887
struct scatterlist sg[2];
28882888
struct virtio_net_ctrl_mac *mac_data;
28892889
struct netdev_hw_addr *ha;
2890-
u8 *promisc_allmulti;
28912890
int uc_count;
28922891
int mc_count;
28932892
void *buf;

0 commit comments

Comments
 (0)