From patchwork Thu Jan 6 19:41:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 5453 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Thu, 06 Jan 2011 17:52:36 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1Pavsx-0004dI-Tl for mchehab@gaivota; Thu, 06 Jan 2011 17:52:36 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Thu, 06 Jan 2011 17:52:35 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Pavk5-0002c9-Mj; Thu, 06 Jan 2011 19:43:26 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753467Ab1AFTnS (ORCPT + 1 other); Thu, 6 Jan 2011 14:43:18 -0500 Received: from mail-ww0-f44.google.com ([74.125.82.44]:43311 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752824Ab1AFTnR (ORCPT ); Thu, 6 Jan 2011 14:43:17 -0500 Received: by wwa36 with SMTP id 36so17760984wwa.1 for ; Thu, 06 Jan 2011 11:43:15 -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:mime-version:content-type:content-disposition:user-agent; bh=fFst3HVrxHRZVtIJW5otKmTT2P82Q327OouiHm9kYbk=; b=bjkqEa0jcvPojkMeE7WOct867eL0OgaxPCTk3L9SLmXM3eOBMXBrcJ3ZsSijaVqbTy F+I4MgPzgCI4TlRTTLakrkJvyTpMZJbUY1A669KXyvvzBa0uJ51vOboJvHRjhQXC58Lf /WIuyWEztyGw6BAKHSRQNUzzMpQuuBklX9Yvs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=M+QDRXsN3yWn/u6/eRAaFC2v/o8iQq+r9xvVWRTy+0hx1KrHmpQWiSluAs9NF63Kta uttko9TmP0tWPYZTqrtdCfxZpkfW6IIm4nWsJ6Fw3BHD+/ShDbPKqUTLkV9VMxaYVxKO 6tEFqakXtaEgpo2IZS3eqxjy1YXKvL5WsAOaY= Received: by 10.216.30.3 with SMTP id j3mr379979wea.42.1294342875327; Thu, 06 Jan 2011 11:41:15 -0800 (PST) Received: from bicker ([41.202.225.146]) by mx.google.com with ESMTPS id c54sm6958509wer.30.2011.01.06.11.41.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 06 Jan 2011 11:41:14 -0800 (PST) Date: Thu, 6 Jan 2011 22:41:00 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] [media] av7110: make array offset unsigned Message-ID: <20110106194059.GC1717@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab In the CA_GET_SLOT_INFO ioctl, we only check whether "num" is too large, but we don't check if it's negative. drivers/media/dvb/ttpci/av7110_ca.c 278 ca_slot_info_t *info=(ca_slot_info_t *)parg; 279 280 if (info->num > 1) 281 return -EINVAL; 282 av7110->ci_slot[info->num].num = info->num; Let's just make it unsigned. Signed-off-by: Dan Carpenter --- Compile tested. -- To unsubscribe from this list: send the line "unsubscribe linux-media" 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/include/linux/dvb/ca.h b/include/linux/dvb/ca.h index c18537f..647015e 100644 --- a/include/linux/dvb/ca.h +++ b/include/linux/dvb/ca.h @@ -27,7 +27,7 @@ /* slot interface types and info */ typedef struct ca_slot_info { - int num; /* slot number */ + unsigned int num; /* slot number */ int type; /* CA interface this slot supports */ #define CA_CI 1 /* CI high level interface */