virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] VSOCK: Use kvfree()
@ 2016-08-02 13:50 Wei Yongjun
  2016-08-02 13:52 ` Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2016-08-02 13:50 UTC (permalink / raw)
  To: Stefan Hajnoczi, Michael S. Tsirkin; +Cc: Wei Yongjun, kvm, virtualization

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(-)

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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] VSOCK: Use kvfree()
  2016-08-02 13:50 [PATCH -next] VSOCK: Use kvfree() Wei Yongjun
@ 2016-08-02 13:52 ` Michael S. Tsirkin
  0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2016-08-02 13:52 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: kvm, Stefan Hajnoczi, virtualization

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-02 13:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02 13:50 [PATCH -next] VSOCK: Use kvfree() Wei Yongjun
2016-08-02 13:52 ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).