Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull vhost cleanups from Michael S Tsirkin:
"Two cleanup patches removing code duplication that got introduced by
changes in rc1. Not fixing crashes, but I'd rather not carry the
duplicate code until the next merge window"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
vhost-scsi: don't open-code kvfree
vhost-net: don't open-code kvfree

+4 -20
+2 -10
drivers/vhost/net.c
··· 700 700 handle_rx(net); 701 701 } 702 702 703 - static void vhost_net_free(void *addr) 704 - { 705 - if (is_vmalloc_addr(addr)) 706 - vfree(addr); 707 - else 708 - kfree(addr); 709 - } 710 - 711 703 static int vhost_net_open(struct inode *inode, struct file *f) 712 704 { 713 705 struct vhost_net *n; ··· 715 723 } 716 724 vqs = kmalloc(VHOST_NET_VQ_MAX * sizeof(*vqs), GFP_KERNEL); 717 725 if (!vqs) { 718 - vhost_net_free(n); 726 + kvfree(n); 719 727 return -ENOMEM; 720 728 } 721 729 ··· 832 840 * since jobs can re-queue themselves. */ 833 841 vhost_net_flush(n); 834 842 kfree(n->dev.vqs); 835 - vhost_net_free(n); 843 + kvfree(n); 836 844 return 0; 837 845 } 838 846
+2 -10
drivers/vhost/scsi.c
··· 1503 1503 return 0; 1504 1504 } 1505 1505 1506 - static void vhost_scsi_free(struct vhost_scsi *vs) 1507 - { 1508 - if (is_vmalloc_addr(vs)) 1509 - vfree(vs); 1510 - else 1511 - kfree(vs); 1512 - } 1513 - 1514 1506 static int vhost_scsi_open(struct inode *inode, struct file *f) 1515 1507 { 1516 1508 struct vhost_scsi *vs; ··· 1542 1550 return 0; 1543 1551 1544 1552 err_vqs: 1545 - vhost_scsi_free(vs); 1553 + kvfree(vs); 1546 1554 err_vs: 1547 1555 return r; 1548 1556 } ··· 1561 1569 /* Jobs can re-queue themselves in evt kick handler. Do extra flush. */ 1562 1570 vhost_scsi_flush(vs); 1563 1571 kfree(vs->dev.vqs); 1564 - vhost_scsi_free(vs); 1572 + kvfree(vs); 1565 1573 return 0; 1566 1574 } 1567 1575