]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/tuner-core.c
V4L/DVB (11251): tuner: prevent invalid initialization of t->config in set_type
[linux-2.6-omap-h63xx.git] / drivers / media / video / tuner-core.c
index 2a957e2beabf9b585823a6d5f33b494d5a1646cb..421475e0ea5995d92f37195f7dfc61a9aab8144c 100644 (file)
@@ -364,7 +364,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;