From: Ian Campbell Subject: Re: [PATCH] Fix assignment of devid value returned from libxl__device_nextid Date: Wed, 26 Jun 2013 17:24:12 +0100 Message-ID: <1372263852.7337.96.camel@zakaz.uk.xensource.com> References: <1372197735-5094-1-git-send-email-jfehlig@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Jim Fehlig , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Wed, 2013-06-26 at 10:41 +0100, George Dunlap wrote: > On Tue, Jun 25, 2013 at 11:02 PM, Jim Fehlig wrote: > > Commit 5420f265 has some misplaced parenthesis that caused devid > > to be assigned 1 or 0 based on checking return value of > > libxl__device_nextid < 0, e.g. > > > > devid = libxl__device_nextid(...) < 0 > > > > This works when only one instance of a given device type exists, but > > subsequent devices of the same type will also have a devid = 1 if > > libxl__device_nextid succeeds. Fix by checking the value assigned to > > devid, e.g. > > > > (devid = libxl__device_nextid(...)) < 0 This is why I hate combined assignment & logic! > > Signed-off-by: Jim Fehlig > > Both for 4.3, and as a patch in general: > > Acked-by: George Dunlap Acked + applied, thanks.