aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/tuners/tuner-xc2028.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-12-05 10:15:16 +0000
committerMark Brown <broonie@linaro.org>2013-12-05 10:15:16 +0000
commitdffe2a3eed105c631500778dfaba0998d7bf8512 (patch)
tree4c2492d710e0b101f57a7f399b3e891129b1c8b4 /drivers/media/tuners/tuner-xc2028.c
parent3b21b35761de8348dd2f7cff9752449281d7a17b (diff)
parent538069756ce13f9d0e0ccb7a17b6935a0bfb7cad (diff)
Merge tag 'v3.10.22' into linux-linaro-lsk
This is the 3.10.22 stable release
Diffstat (limited to 'drivers/media/tuners/tuner-xc2028.c')
-rw-r--r--drivers/media/tuners/tuner-xc2028.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c
index 878d2c4d9e8..9771cd83c06 100644
--- a/drivers/media/tuners/tuner-xc2028.c
+++ b/drivers/media/tuners/tuner-xc2028.c
@@ -24,6 +24,9 @@
#include <linux/dvb/frontend.h>
#include "dvb_frontend.h"
+/* Max transfer size done by I2C transfer functions */
+#define MAX_XFER_SIZE 80
+
/* Registers (Write-only) */
#define XREG_INIT 0x00
#define XREG_RF_FREQ 0x02
@@ -547,7 +550,10 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type,
{
struct xc2028_data *priv = fe->tuner_priv;
int pos, rc;
- unsigned char *p, *endp, buf[priv->ctrl.max_len];
+ unsigned char *p, *endp, buf[MAX_XFER_SIZE];
+
+ if (priv->ctrl.max_len > sizeof(buf))
+ priv->ctrl.max_len = sizeof(buf);
tuner_dbg("%s called\n", __func__);