[-next] VSOCK: Use kvfree()
diff mbox

Message ID 1470145842-17614-1-git-send-email-weiyj.lk@gmail.com
State New
Headers show

Commit Message

Wei Yongjun Aug. 2, 2016, 1:50 p.m. UTC
Use kvfree() instead of open-coding it.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
 drivers/vhost/vsock.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Michael S. Tsirkin Aug. 2, 2016, 1:52 p.m. UTC | #1
On Tue, Aug 02, 2016 at 01:50:42PM +0000, Wei Yongjun wrote:
> Use kvfree() instead of open-coding it.
> 
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>

Applied, thanks!

> ---
>  drivers/vhost/vsock.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
> index 028ca16..0ddf3a2 100644
> --- a/drivers/vhost/vsock.c
> +++ b/drivers/vhost/vsock.c
> @@ -434,10 +434,7 @@ err:
>  
>  static void vhost_vsock_free(struct vhost_vsock *vsock)
>  {
> -	if (is_vmalloc_addr(vsock))
> -		vfree(vsock);
> -	else
> -		kfree(vsock);
> +	kvfree(vsock);
>  }
>  
>  static int vhost_vsock_dev_open(struct inode *inode, struct file *file)
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 028ca16..0ddf3a2 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -434,10 +434,7 @@  err:
 
 static void vhost_vsock_free(struct vhost_vsock *vsock)
 {
-	if (is_vmalloc_addr(vsock))
-		vfree(vsock);
-	else
-		kfree(vsock);
+	kvfree(vsock);
 }
 
 static int vhost_vsock_dev_open(struct inode *inode, struct file *file)