From patchwork Tue Aug 23 19:15:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1089512 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7NJI1rL004855 for ; Tue, 23 Aug 2011 19:18:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756016Ab1HWTR6 (ORCPT ); Tue, 23 Aug 2011 15:17:58 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:34229 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755943Ab1HWTR5 (ORCPT ); Tue, 23 Aug 2011 15:17:57 -0400 Received: by wyg24 with SMTP id 24so328949wyg.19 for ; Tue, 23 Aug 2011 12:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=s02OGitpkgSAY2IHs8Xl2qlk6uLCEq0aubeoFzZIDVs=; b=hVGgqjpI7X1k+YDPnOAbMjWteJ+59Lk5ufksVad2d7XdJ6skAYoXwCME4QdLpjyoo7 O7kRgmNOFso1wZvIlhdJuAKwISHISWv3+m4acqUgNVWvnCyjNA5WpiL9Rfe4E7o0BCT9 DMQ0WNYhWFBpxQ/Fs7g9CvvSCec/TmEQ247vE= Received: by 10.227.54.193 with SMTP id r1mr303356wbg.45.1314127076318; Tue, 23 Aug 2011 12:17:56 -0700 (PDT) Received: from shale.localdomain ([212.49.88.34]) by mx.google.com with ESMTPS id el9sm217398wbb.58.2011.08.23.12.17.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 23 Aug 2011 12:17:53 -0700 (PDT) Date: Tue, 23 Aug 2011 22:15:35 +0300 From: Dan Carpenter To: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Cc: "open list:BROADCOM SPECIFIC..." , kernel-janitors@vger.kernel.org Subject: [patch -next v2] bcma: signedness bug in bcma_get_next_core() Message-ID: <20110823191535.GL12248@shale.localdomain> References: <20110818133809.GG4786@shale.localdomain> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 23 Aug 2011 19:18:01 +0000 (UTC) The u32 would never be less than zero so the error handling would break. I changed it to s32 to match how bcma_erom_get_mst_port() is declared. Signed-off-by: Dan Carpenter --- v2: the first version used "int" instead of "s32". -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c index 0ea390f..cad9948 100644 --- a/drivers/bcma/scan.c +++ b/drivers/bcma/scan.c @@ -281,7 +281,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, /* get & parse master ports */ for (i = 0; i < ports[0]; i++) { - u32 mst_port_d = bcma_erom_get_mst_port(bus, eromptr); + s32 mst_port_d = bcma_erom_get_mst_port(bus, eromptr); if (mst_port_d < 0) return -EILSEQ; }