mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
media: vivid: check if the cec_adapter is valid
commit ed356f1104 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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
[ Naresh: Fixed rebase conflict ]
Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -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);
|
||||
cec_set_edid_phys_addr(edid->edid, edid->blocks * 128, adap->phys_addr);
|
||||
if (adap)
|
||||
cec_set_edid_phys_addr(edid->edid, edid->blocks * 128, adap->phys_addr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user