From: Janne Grunau Date: Tue, 1 Sep 2009 22:24:08 +0000 (-0300) Subject: V4L/DVB (12686): dvb-core: check supported QAM modulations X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f51fad85af7b296b56031747c873c309b24ff77c;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git V4L/DVB (12686): dvb-core: check supported QAM modulations Check the modulation in dvb_frontend_check_parameters against frontend's capabilties for FE_QAM devices. Signed-off-by: Janne Grunau Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 0cb6c09719f2..d13ebcb0c6b6 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -838,6 +838,15 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe, } } + /* check for supported modulation */ + if (fe->ops.info.type == FE_QAM && + (parms->u.qam.modulation > QAM_AUTO || + !((1 << (parms->u.qam.modulation + 10)) & fe->ops.info.caps))) { + printk(KERN_WARNING "DVB: adapter %i frontend %i modulation %u not supported\n", + fe->dvb->num, fe->id, parms->u.qam.modulation); + return -EINVAL; + } + return 0; }