mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
[media] cx25821: off by one in cx25821_vidioc_s_input()
If "i" is 2 then when we call cx25821_video_mux() we'd end up going past the end of the cx25821_boards[dev->board]->input[]. The INPUT() macro obfuscates what's going on in that function so it's a bit hard to follow. And as Mauro points out the hard coded 2 is not very helpful. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
8c4343e590
commit
567a23f438
2 changed files with 3 additions and 2 deletions
|
@ -1312,7 +1312,7 @@ int cx25821_vidioc_s_input(struct file *file, void *priv, unsigned int i)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i > 2) {
|
if (i >= CX25821_NR_INPUT) {
|
||||||
dprintk(1, "%s(): -EINVAL\n", __func__);
|
dprintk(1, "%s(): -EINVAL\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@
|
||||||
#define CX25821_BOARD_CONEXANT_ATHENA10 1
|
#define CX25821_BOARD_CONEXANT_ATHENA10 1
|
||||||
#define MAX_VID_CHANNEL_NUM 12
|
#define MAX_VID_CHANNEL_NUM 12
|
||||||
#define VID_CHANNEL_NUM 8
|
#define VID_CHANNEL_NUM 8
|
||||||
|
#define CX25821_NR_INPUT 2
|
||||||
|
|
||||||
struct cx25821_fmt {
|
struct cx25821_fmt {
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -196,7 +197,7 @@ struct cx25821_board {
|
||||||
unsigned char radio_addr;
|
unsigned char radio_addr;
|
||||||
|
|
||||||
u32 clk_freq;
|
u32 clk_freq;
|
||||||
struct cx25821_input input[2];
|
struct cx25821_input input[CX25821_NR_INPUT];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cx25821_subid {
|
struct cx25821_subid {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue