From patchwork Sat Mar 6 11:09:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 83894 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o26BABoa026645 for ; Sat, 6 Mar 2010 11:10:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753398Ab0CFLKL (ORCPT ); Sat, 6 Mar 2010 06:10:11 -0500 Received: from mail-fx0-f219.google.com ([209.85.220.219]:60974 "EHLO mail-fx0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753269Ab0CFLKJ (ORCPT ); Sat, 6 Mar 2010 06:10:09 -0500 Received: by fxm19 with SMTP id 19so4950065fxm.21 for ; Sat, 06 Mar 2010 03:10:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mail-followup-to:mime-version:content-type :content-disposition:user-agent; bh=bTnwbR7CIha4jpsSpthGgMCZF8U8ZDCbNKbvlwsjcb4=; b=OuycLqNn7tBDuDyTM1I8igcOxXR+loXCnliiDzP+/OI1Jrc/6rGOdNlvOAGDDZFi8U WzhAOu4qJky64nglJHFaHEFcmQTTJXM2029xDedr77DGk9SkfBEhSg5sg1l00g02g/aa 5SYdqHFvUNqxRtw6jkQVV4/hzMtQ58QWz4e2w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; b=wVQX9aISiiQPSugA6qPpsqnFZNPtUVV2QCfSQp49FuNb7hTju38hhK+PQAtudFjNH5 /gzOUuhjIkUn/+hLtrF0FyD0ipXjgyqdYrrnzWqJHSUq4lYezQaOXJ0inc6E4DMuAbBs hiV2Q5dsU+c/60Ve34UGBt+gDyLqm+6Z7rwGA= Received: by 10.87.68.35 with SMTP id v35mr3177062fgk.25.1267873807965; Sat, 06 Mar 2010 03:10:07 -0800 (PST) Received: from bicker ([62.56.130.5]) by mx.google.com with ESMTPS id d8sm3795279fga.19.2010.03.06.03.10.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 06 Mar 2010 03:10:06 -0800 (PST) Date: Sat, 6 Mar 2010 14:09:44 +0300 From: Dan Carpenter To: Dmitry Torokhov Cc: Scott Moreau , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] joystick: off by one error Message-ID: <20100306110944.GG4958@bicker> Mail-Followup-To: Dan Carpenter , Dmitry Torokhov , Scott Moreau , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 06 Mar 2010 11:10:12 +0000 (UTC) diff --git a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c index ae998d9..7a55714 100644 --- a/drivers/input/joystick/gamecon.c +++ b/drivers/input/joystick/gamecon.c @@ -819,7 +819,7 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type) int i; int err; - if (pad_type < 1 || pad_type > GC_MAX) { + if (pad_type < 1 || pad_type >= GC_MAX) { pr_err("Pad type %d unknown\n", pad_type); return -EINVAL; }