From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758838AbcISKGR (ORCPT ); Mon, 19 Sep 2016 06:06:17 -0400 Received: from 8bytes.org ([81.169.241.247]:52317 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754543AbcISKGI (ORCPT ); Mon, 19 Sep 2016 06:06:08 -0400 Date: Mon, 19 Sep 2016 12:06:05 +0200 From: Joerg Roedel To: Colin King Cc: Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kvm: svm: fix unsigned compare less than zero comparison Message-ID: <20160919100605.GA3541@8bytes.org> References: <20160919061159.6341-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160919061159.6341-1-colin.king@canonical.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 19, 2016 at 07:11:59AM +0100, Colin King wrote: > From: Colin Ian King > > vm_data->avic_vm_id is a u32, so the check for a error > return (less than zero) such as -EAGAIN from > avic_get_next_vm_id currently has no effect whatsoever. > Fix this by using a temporary int for the comparison > and assign vm_data->avic_vm_id to this. I used an explicit > u32 cast in the assignment to show why vm_data->avic_vm_id > cannot be used in the assign/compare steps. > > Signed-off-by: Colin Ian King Acked-by: Joerg Roedel