From 0dce716d8bb66f3d609fa9b509a3102c0a4d589e Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Fri, 3 Oct 2008 10:50:00 -0400 Subject: S2API: Stop an OOPS if illegal commands are dumped in S2API. From: Darron Broad Quick fix to stop an OOPS if illegal commands are dumped in S2API. Priority: normal Signed-off-by: Steven Toth Signed-off-by: Darron Broad --- linux/drivers/media/dvb/dvb-core/dvb_frontend.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'linux') diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index 6f0dc252f..3e9cbac17 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -918,6 +918,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.3