mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
media: ir_toy: Validate the maximum tx carrier
Reject any carrier the hardware cannot generate. This also fixes
a divide by zero if a carrier of U32_MAX/16 is set.
Fixes: 8bff1386d6 ("media: ir_toy: allow tx carrier to be set")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Young <sean@mess.org>
Acked-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
e252955466
commit
27303392aa
|
|
@ -372,7 +372,7 @@ static int irtoy_tx_carrier(struct rc_dev *rc, uint32_t carrier)
|
|||
u8 buf[3];
|
||||
int err;
|
||||
|
||||
if (carrier < 11800)
|
||||
if (carrier < 11800 || carrier > 3000000)
|
||||
return -EINVAL;
|
||||
|
||||
buf[0] = 0x06;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user