Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752756AbbGOOsy (ORCPT ); Wed, 15 Jul 2015 10:48:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46256 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732AbbGOOsx (ORCPT ); Wed, 15 Jul 2015 10:48:53 -0400 From: Igor Mammedov To: linux-kernel@vger.kernel.org Cc: dan.carpenter@oracle.com, julia.lawall@lip6.fr, mst@redhat.com, kvm@vger.kernel.org Subject: [PATCH] fixup! vhost: extend memory regions allocation to vmalloc Date: Wed, 15 Jul 2015 16:48:50 +0200 Message-Id: <1436971730-277452-1-git-send-email-imammedo@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1176 Lines: 40 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) issue introduced by 4de7255f7d2be5e51664c6ac6011ffd6e5463571 in vhost-next tree Spotted-by: Dan Carpenter Suggested-by: Julia Lawall Signed-off-by: Igor Mammedov --- drivers/vhost/vhost.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index a9fe859..3702487 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -683,11 +683,8 @@ static void *vhost_kvzalloc(unsigned long size) { void *n = kzalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_REPEAT); - if (!n) { + if (!n) n = vzalloc(size); - if (!n) - return ERR_PTR(-ENOMEM); - } return n; } -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/