The patch number 11251 was added via Michael Krufky <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <[email protected]>

------

From: Michael Krufky  <[email protected]>
tuner: prevent invalid initialization of t->config in set_type


Drivers that don't set "config" directly in the set_type function will
end up with an invalid configuration value. Check that the value is sane,
otherwise initialize to 0.

Thanks to James Edward Geiger & Steven Toth for reporting this bug.

Priority: high

Signed-off-by: Michael Krufky <[email protected]>
Cc: Steven Toth <[email protected]>
Cc: James Edward Geiger <[email protected]>


---

 linux/drivers/media/video/tuner-core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -r 1fd54a62abde -r 2d9472a8d1d2 linux/drivers/media/video/tuner-core.c
--- a/linux/drivers/media/video/tuner-core.c    Thu Mar 12 23:13:12 2009 -0300
+++ b/linux/drivers/media/video/tuner-core.c    Sat Mar 28 14:35:26 2009 -0400
@@ -365,7 +365,8 @@ static void set_type(struct i2c_client *
        }
 
        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;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/2d9472a8d1d255677b3bf5ef47dd04c47378d188

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to