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

vhost-scsi: don't open-code kvfree

Now that we have kvfree, use it in vhost-scsi instead of
the open-coded version.

Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


+2 -10
+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