V4L/DVB (9171): S2API: Stop an OOPS if illegal commands are dumped in S2API.
authorDarron Broad <darron@kewl.org>
Fri, 3 Oct 2008 14:50:00 +0000 (11:50 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 13 Oct 2008 14:25:10 +0000 (12:25 -0200)
Quick fix to stop an OOPS if illegal commands are dumped in S2API.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-core/dvb_frontend.c

index 4c3f0d7e355c5e4c27c71a407ffc1d50524d6a90..f44b64b8e614694c3edb25e1e2b4f1988a610d24 100644 (file)
@@ -848,6 +848,13 @@ void dtv_property_dump(struct dtv_property *tvp)
 {
        int i;
 
+       if( (tvp->cmd <= 0 || tvp->cmd > DTV_DELIVERY_SYSTEM) &&
+                       tvp->cmd != DTV_API_VERSION) {
+               printk("%s: tvp.cmd = 0x%08x (undefined/unknown/invalid)\n",
+                       __func__, tvp->cmd);
+               return;
+       }
+
        printk("%s() tvp.cmd    = 0x%08x (%s)\n"
                ,__FUNCTION__
                ,tvp->cmd