From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755765AbdESV3A (ORCPT ); Fri, 19 May 2017 17:29:00 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:48368 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754949AbdESV25 (ORCPT ); Fri, 19 May 2017 17:28:57 -0400 Date: Sat, 20 May 2017 00:28:48 +0300 From: Dan Carpenter To: "Ed L. Cashin" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] aoe: harmless underflow in minor_get_static() Message-ID: <20170519212848.xba4nc2zvr5xcjxg@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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;