linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Dan Carpenter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
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
Subject: [tip:x86/cleanups] x86/ldt: Make a size argument unsigned
Date: Sat, 10 Dec 2016 00:12:50 -0800	[thread overview]
Message-ID: <tip-296dc5806de57dc84fce000d60fc201ba40f96e8@git.kernel.org> (raw)
In-Reply-To: <20161208105602.GA11382@elgon.mountain>

Commit-ID:  296dc5806de57dc84fce000d60fc201ba40f96e8
Gitweb:     http://git.kernel.org/tip/296dc5806de57dc84fce000d60fc201ba40f96e8
Author:     Dan Carpenter <dan.carpenter@oracle.com>
AuthorDate: Thu, 8 Dec 2016 13:56:03 +0300
Committer:  Thomas Gleixner <tglx@linutronix.de>
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 <dan.carpenter@oracle.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: kernel-janitors@vger.kernel.org
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/20161208105602.GA11382@elgon.mountain
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 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;

      parent reply	other threads:[~2016-12-10  8:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 10:56 [patch] x86/ldt: make a size variable unsigned Dan Carpenter
2016-12-08 22:29 ` Andy Lutomirski
2016-12-08 23:08 ` Thomas Gleixner
2016-12-10  8:12 ` tip-bot for Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-296dc5806de57dc84fce000d60fc201ba40f96e8@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).