summaryrefslogtreecommitdiff
path: root/drivers/media/dvb-frontends/si21xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb-frontends/si21xx.c')
-rw-r--r--drivers/media/dvb-frontends/si21xx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb-frontends/si21xx.c
index 73b47cc6a13b..16850e2bf02f 100644
--- a/drivers/media/dvb-frontends/si21xx.c
+++ b/drivers/media/dvb-frontends/si21xx.c
@@ -236,6 +236,9 @@ static int si21_writeregs(struct si21xx_state *state, u8 reg1,
.len = len + 1
};
+ if (len > sizeof(buf) - 1)
+ return -EINVAL;
+
msg.buf[0] = reg1;
memcpy(msg.buf + 1, data, len);