From patchwork Mon Nov 2 16:26:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 57051 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA2GGMca005386 for ; Mon, 2 Nov 2009 16:16:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755783AbZKBQPj (ORCPT ); Mon, 2 Nov 2009 11:15:39 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755749AbZKBQPb (ORCPT ); Mon, 2 Nov 2009 11:15:31 -0500 Received: from ey-out-2122.google.com ([74.125.78.24]:11680 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755741AbZKBQPa (ORCPT ); Mon, 2 Nov 2009 11:15:30 -0500 Received: by ey-out-2122.google.com with SMTP id d26so429862eyd.19 for ; Mon, 02 Nov 2009 08:15:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=pn0+LvMUGcF8XEebFSeGCPcKbO4YcoK3ZeqUXi29TG0=; b=wOQRRVTGA+q0bOTutpRkLwZqWpkLsZ7E/tBPFu0NFOn4XUrZ6Lr8iwu+4Ulq/JR+/t sIES/8LU9isWQB8utsssiHuPsWn3edUl3iwVllxvSbrj2ecplwd52SBPIkBE+lVhftRg i/EGMatTGWoJPXSRt88hf4gEkZohlZ3V6qfNk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=AcaSHfCMSYfwp0k93i+00l4enctP/n3IySLXe/yXNpMNV4kGQCdxBeGu0zXTHckIG3 dzLc6FZVn6LkQ+ZMXIyF9Wh3u9F34tuVPVPhnJEvmdCnXluei5KKTo5v/q9BP2qrKOK3 YZUem2SThbICafx3nW4qWoVs3GFCRXaLslHSM= Received: by 10.216.90.81 with SMTP id d59mr2347477wef.29.1257178534536; Mon, 02 Nov 2009 08:15:34 -0800 (PST) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 7sm16014436eyg.9.2009.11.02.08.15.20 (version=SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 08:15:30 -0800 (PST) Message-ID: <4AEF0837.8080503@gmail.com> Date: Mon, 02 Nov 2009 17:26:31 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Thunderbird/3.0b4 MIME-Version: 1.0 To: Mauro Carvalho Chehab , linux-media@vger.kernel.org, Andrew Morton , LKML Subject: [PATCH] sms-cards.c: Ensure index is positive Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff --git a/drivers/media/dvb/siano/sms-cards.c b/drivers/media/dvb/siano/sms-cards.c index 0420e28..52f0dac 100644 --- a/drivers/media/dvb/siano/sms-cards.c +++ b/drivers/media/dvb/siano/sms-cards.c @@ -99,7 +99,7 @@ static struct sms_board sms_boards[] = { struct sms_board *sms_get_board(int id) { - BUG_ON(id >= ARRAY_SIZE(sms_boards)); + BUG_ON(id >= ARRAY_SIZE(sms_boards) || id < 0); return &sms_boards[id]; }