Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753369AbcLHG5r (ORCPT ); Thu, 8 Dec 2016 01:57:47 -0500 Received: from mx2.suse.de ([195.135.220.15]:53848 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752221AbcLHG5q (ORCPT ); Thu, 8 Dec 2016 01:57:46 -0500 Subject: Re: [PATCH 1/1 v2] xen: set error code on failures To: Pan Bian , David Vrabel , Boris Ostrovsky , xen-devel@lists.xenproject.org References: <1480926185-19926-1-git-send-email-bianpan2016@163.com> Cc: linux-kernel@vger.kernel.org From: Juergen Gross Message-ID: Date: Thu, 8 Dec 2016 07:57:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1480926185-19926-1-git-send-email-bianpan2016@163.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 578 Lines: 16 On 05/12/16 09:23, Pan Bian wrote: > Variable rc is reset in the loop, and its value will be non-negative > during the second and after repeat of the loop. If it fails to allocate > memory then, it may return a non-negative integer, which indicates no > error. This patch fixes the bug, assigning "-ENOMEM" to rc when > kzalloc() or alloc_page() returns NULL, and removing the initialization > of rc outside of the loop. > > v1 is reviewed by: Juergen Gross > > Signed-off-by: Pan Bian Commited to xen/tip.git for-linus-4.10 Juergen