Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752782AbcLJIOF (ORCPT ); Sat, 10 Dec 2016 03:14:05 -0500 Received: from terminus.zytor.com ([198.137.202.10]:49264 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbcLJIOE (ORCPT ); Sat, 10 Dec 2016 03:14:04 -0500 Date: Sat, 10 Dec 2016 00:12:50 -0800 From: tip-bot for Dan Carpenter Message-ID: Cc: aryabinin@virtuozzo.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, dave.hansen@linux.intel.com, akpm@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, dan.carpenter@oracle.com, luto@kernel.org Reply-To: hpa@zytor.com, akpm@linux-foundation.org, mingo@kernel.org, luto@kernel.org, dan.carpenter@oracle.com, linux-kernel@vger.kernel.org, aryabinin@virtuozzo.com, tglx@linutronix.de, dave.hansen@linux.intel.com In-Reply-To: <20161208105602.GA11382@elgon.mountain> References: <20161208105602.GA11382@elgon.mountain> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cleanups] x86/ldt: Make a size argument unsigned Git-Commit-ID: 296dc5806de57dc84fce000d60fc201ba40f96e8 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1641 Lines: 43 Commit-ID: 296dc5806de57dc84fce000d60fc201ba40f96e8 Gitweb: http://git.kernel.org/tip/296dc5806de57dc84fce000d60fc201ba40f96e8 Author: Dan Carpenter AuthorDate: Thu, 8 Dec 2016 13:56:03 +0300 Committer: Thomas Gleixner CommitDate: Sat, 10 Dec 2016 00:24:39 +0100 x86/ldt: Make a size argument unsigned My static checker complains that we put an upper bound on the "size" argument but not a lower bound. The checker is not smart enough to know the possible ranges of "old_mm->context.ldt->size" from init_new_context_ldt() so it thinks maybe it could be negative. Let's make it unsigned to silence the warning and future proof the code a bit. Signed-off-by: Dan Carpenter Acked-by: Andy Lutomirski Cc: Dave Hansen Cc: kernel-janitors@vger.kernel.org Cc: Andrey Ryabinin Cc: Andrew Morton Link: http://lkml.kernel.org/r/20161208105602.GA11382@elgon.mountain Signed-off-by: Thomas Gleixner --- arch/x86/kernel/ldt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 6707039..e25b668 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -34,7 +34,7 @@ static void flush_ldt(void *current_mm) } /* The caller must call finalize_ldt_struct on the result. LDT starts zeroed. */ -static struct ldt_struct *alloc_ldt_struct(int size) +static struct ldt_struct *alloc_ldt_struct(unsigned int size) { struct ldt_struct *new_ldt; int alloc_size;