Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f51fad85 authored by Janne Grunau's avatar Janne Grunau Committed by Mauro Carvalho Chehab
Browse files

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: default avatarJanne Grunau <j@jannau.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 01886255
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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;
}