From 4aae8efb4908fa3f80dc1177d093443bc09adf5f Mon Sep 17 00:00:00 2001 From: Darron Broad Date: Fri, 3 Oct 2008 11:50:00 -0300 Subject: V4L/DVB (9171): S2API: Stop an OOPS if illegal commands are dumped in S2API. Quick fix to stop an OOPS if illegal commands are dumped in S2API. Signed-off-by: Darron Broad Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-core/dvb_frontend.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 4c3f0d7e355c..f44b64b8e614 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -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 -- cgit v1.2.2