diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2014-06-12 12:00:01 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-23 02:22:48 -0400 |
commit | 68404441557d8db5ac853379a4fb9c1adedea4fd (patch) | |
tree | e0861964438f5ed14c909d73a9d85f86a50fcf50 /drivers/vhost/scsi.c | |
parent | d04257b07f2362d4eb550952d5bf5f4241a8046d (diff) |
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>
Diffstat (limited to 'drivers/vhost/scsi.c')
-rw-r--r-- | drivers/vhost/scsi.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 4f4ffa4c604e..69906cacd04f 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
@@ -1503,14 +1503,6 @@ static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features) | |||
1503 | return 0; | 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 | static int vhost_scsi_open(struct inode *inode, struct file *f) | 1506 | static int vhost_scsi_open(struct inode *inode, struct file *f) |
1515 | { | 1507 | { |
1516 | struct vhost_scsi *vs; | 1508 | struct vhost_scsi *vs; |
@@ -1550,7 +1542,7 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) | |||
1550 | return 0; | 1542 | return 0; |
1551 | 1543 | ||
1552 | err_vqs: | 1544 | err_vqs: |
1553 | vhost_scsi_free(vs); | 1545 | kvfree(vs); |
1554 | err_vs: | 1546 | err_vs: |
1555 | return r; | 1547 | return r; |
1556 | } | 1548 | } |
@@ -1569,7 +1561,7 @@ static int vhost_scsi_release(struct inode *inode, struct file *f) | |||
1569 | /* Jobs can re-queue themselves in evt kick handler. Do extra flush. */ | 1561 | /* Jobs can re-queue themselves in evt kick handler. Do extra flush. */ |
1570 | vhost_scsi_flush(vs); | 1562 | vhost_scsi_flush(vs); |
1571 | kfree(vs->dev.vqs); | 1563 | kfree(vs->dev.vqs); |
1572 | vhost_scsi_free(vs); | 1564 | kvfree(vs); |
1573 | return 0; | 1565 | return 0; |
1574 | } | 1566 | } |
1575 | 1567 | ||