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

Commit 8598e3f6 authored by Hans Verkuil's avatar Hans Verkuil Committed by Greg Kroah-Hartman
Browse files

media: vivid: check if the cec_adapter is valid



commit ed356f110403f6acc64dcbbbfdc38662ab9b06c2 upstream.

If CEC is not enabled for the vivid driver, then the adap pointer is NULL
and 'adap->phys_addr' will fail.

Cc: <stable@vger.kernel.org>      # for v4.12 and up
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
[ Naresh: Fixed rebase conflict ]
Signed-off-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aa06083d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -841,6 +841,7 @@ int vidioc_g_edid(struct file *file, void *_fh,
	if (edid->start_block + edid->blocks > dev->edid_blocks)
		edid->blocks = dev->edid_blocks - edid->start_block;
	memcpy(edid->edid, dev->edid, edid->blocks * 128);
	if (adap)
		cec_set_edid_phys_addr(edid->edid, edid->blocks * 128, adap->phys_addr);
	return 0;
}