summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/tuner-core.c')
-rw-r--r--linux/drivers/media/video/tuner-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index 9a0ddd57c..9960fb357 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -365,7 +365,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
}
t->type = type;
- t->config = new_config;
+ /* prevent invalid config values */
+ t->config = ((new_config >= 0) && (new_config < 256)) ? new_config : 0;
if (tuner_callback != NULL) {
tuner_dbg("defining GPIO callback\n");
t->fe.callback = tuner_callback;