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

Commit 7feeb148 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] cx88: fix register mask



Ensure that the register is aligned to a dword, otherwise the read could
read out-of-range data.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent da6a8553
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1360,7 +1360,7 @@ static int vidioc_g_register (struct file *file, void *fh,
	struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
	struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;


	/* cx2388x has a 24-bit register space */
	/* cx2388x has a 24-bit register space */
	reg->val = cx_read(reg->reg & 0xffffff);
	reg->val = cx_read(reg->reg & 0xfffffc);
	reg->size = 4;
	reg->size = 4;
	return 0;
	return 0;
}
}
@@ -1370,7 +1370,7 @@ static int vidioc_s_register (struct file *file, void *fh,
{
{
	struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
	struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;


	cx_write(reg->reg & 0xffffff, reg->val);
	cx_write(reg->reg & 0xfffffc, reg->val);
	return 0;
	return 0;
}
}
#endif
#endif