Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645960 > unrolled thread

[PATCH] aoe: harmless underflow in minor_get_static()

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2017-05-19 23:30 +0200
Last post2017-05-19 23:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] aoe: harmless underflow in minor_get_static() Dan Carpenter <dan.carpenter@oracle.com> - 2017-05-19 23:30 +0200

#1645960 — [PATCH] aoe: harmless underflow in minor_get_static()

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-05-19 23:30 +0200
Subject[PATCH] aoe: harmless underflow in minor_get_static()
Message-ID<tIXDb-823-13@gated-at.bofh.it>
The "aoemin" comes from revalidate() in drivers/block/aoe/aoechr.c.  It
can be negative.  We cap the upper bound but not the lower bound so
that's an underflow bug.  But it doesn't matter because we check "n"
against N_DEVS so it all works out fine in the end.

Anyway, let's silence the static checker warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index ffd1947500c6..eddd0ecc9e0b 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -58,7 +58,7 @@ minor_get_dyn(ulong *sysminor)
 }
 
 static int
-minor_get_static(ulong *sysminor, ulong aoemaj, int aoemin)
+minor_get_static(ulong *sysminor, ulong aoemaj, unsigned int aoemin)
 {
 	ulong flags;
 	ulong n;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web