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

Commit e28d0509 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian Committed by Gerrit - the friendly Code Review server
Browse files

[media] media: Init the reserved fields of struct media_link_desc



struct media_link_desc is copy_to_user'ed as the return value of
MEDIA_IOC_ENUM_LINKS. When copying, the driver is omitting to initialise
the reserved fields.  This commit fixes that by initialising the
reserved fields to 0.

CRs-Fixed: 570757
Change-Id: I230e2666c0845cc36399518a0f2c94db664382d1
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent 219364c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -141,7 +141,7 @@ static long __media_device_enum_links(struct media_device *mdev,
		unsigned int p;
		unsigned int p;


		for (p = 0; p < entity->num_pads; p++) {
		for (p = 0; p < entity->num_pads; p++) {
			struct media_pad_desc pad;
			struct media_pad_desc pad = {0};
			media_device_kpad_to_upad(&entity->pads[p], &pad);
			media_device_kpad_to_upad(&entity->pads[p], &pad);
			if (copy_to_user(&links->pads[p], &pad, sizeof(pad)))
			if (copy_to_user(&links->pads[p], &pad, sizeof(pad)))
				return -EFAULT;
				return -EFAULT;