Return-Path: Received: from www.linuxtv.org ([130.149.80.248]:48046 "EHLO www.linuxtv.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751255AbbEAJIC (ORCPT ); Fri, 1 May 2015 05:08:02 -0400 Message-Id: From: Mauro Carvalho Chehab Date: Thu, 30 Apr 2015 19:26:22 +0200 Subject: [git:media_tree/master] [media] af9013: Don't accept invalid bandwidth To: linuxtv-commits@linuxtv.org Cc: stable@vger.kernel.org Reply-to: linux-media@vger.kernel.org Sender: stable-owner@vger.kernel.org List-ID: This is an automatic generated email to let you know that the following patch were queued at the http://git.linuxtv.org/cgit.cgi/media_tree.git tree: Subject: [media] af9013: Don't accept invalid bandwidth Author: Mauro Carvalho Chehab Date: Tue Apr 28 19:02:19 2015 -0300 If userspace sends an invalid bandwidth, it should either return EINVAL or switch to auto mode. This driver will go past an array and program the hardware on a wrong way if this happens. Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab drivers/media/dvb-frontends/af9013.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) --- http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=d7b76c91f471413de9ded837bddeca2164786571 diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c index 8001690..ba6c8f6 100644 --- a/drivers/media/dvb-frontends/af9013.c +++ b/drivers/media/dvb-frontends/af9013.c @@ -605,6 +605,10 @@ static int af9013_set_frontend(struct dvb_frontend *fe) } } + /* Return an error if can't find bandwidth or the right clock */ + if (i == ARRAY_SIZE(coeff_lut)) + return -EINVAL; + ret = af9013_wr_regs(state, 0xae00, coeff_lut[i].val, sizeof(coeff_lut[i].val)); }