mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
vhost_net: examine pointer types during un-producing
After commitfc72d1d54d
("tuntap: XDP transmission"), we can actually queueing XDP pointers in the pointer ring, so we should examine the pointer type before freeing the pointer. Fixes:fc72d1d54d
("tuntap: XDP transmission") Reported-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
303fd71b37
commit
3a4030761e
3 changed files with 7 additions and 2 deletions
|
@ -25,6 +25,7 @@ struct ptr_ring *tun_get_tx_ring(struct file *file);
|
|||
bool tun_is_xdp_buff(void *ptr);
|
||||
void *tun_xdp_to_ptr(void *ptr);
|
||||
void *tun_ptr_to_xdp(void *ptr);
|
||||
void tun_ptr_free(void *ptr);
|
||||
#else
|
||||
#include <linux/err.h>
|
||||
#include <linux/errno.h>
|
||||
|
@ -50,5 +51,8 @@ static inline void *tun_ptr_to_xdp(void *ptr)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void tun_ptr_free(void *ptr)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_TUN */
|
||||
#endif /* __IF_TUN_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue