]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: fix error handling for memory region alloc
authorIgor Mammedov <imammedo@redhat.com>
Wed, 15 Jul 2015 14:48:50 +0000 (16:48 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 27 Jul 2015 15:05:05 +0000 (18:05 +0300)
commiteb868ff4f9333ddc2eb025923e08f811fb031cac
tree1db1d0a687ebb0f980d9083ba65d9e447faafab0
parent111c4d1ba14e2b76c3dea9bdc4463988009ecd2b
vhost: fix error handling for memory region alloc

callers of vhost_kvzalloc() expect the same behaviour on
allocation error as from kmalloc/vmalloc i.e. NULL return
value. So just return vzmalloc() returned value instead of
returning ERR_PTR(-ENOMEM)

Fixes: b7f9f1366d00b7 ("vhost: extend memory regions allocation to vmalloc")
Spotted-by: Dan Carpenter <dan.carpenter@oracle.com>
Suggested-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vhost.c