* [PATCH 4.9] media: vivid: check if the cec_adapter is valid
@ 2019-05-02 5:15 Naresh Kamboju
2019-05-02 11:46 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Naresh Kamboju @ 2019-05-02 5:15 UTC (permalink / raw)
To: stable; +Cc: Naresh Kamboju, Hans Verkuil, Mauro Carvalho Chehab
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> # v4.9
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>
---
drivers/media/platform/vivid/vivid-vid-common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c
index f9a810e3f521..d380c2da1926 100644
--- a/drivers/media/platform/vivid/vivid-vid-common.c
+++ b/drivers/media/platform/vivid/vivid-vid-common.c
@@ -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;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 4.9] media: vivid: check if the cec_adapter is valid
2019-05-02 5:15 [PATCH 4.9] media: vivid: check if the cec_adapter is valid Naresh Kamboju
@ 2019-05-02 11:46 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-05-02 11:46 UTC (permalink / raw)
To: Naresh Kamboju; +Cc: stable, Hans Verkuil, Mauro Carvalho Chehab
On Thu, May 02, 2019 at 06:15:46AM +0100, Naresh Kamboju wrote:
> 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> # v4.9
> 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>
> ---
> drivers/media/platform/vivid/vivid-vid-common.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c
> index f9a810e3f521..d380c2da1926 100644
> --- a/drivers/media/platform/vivid/vivid-vid-common.c
> +++ b/drivers/media/platform/vivid/vivid-vid-common.c
> @@ -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)
No tabs?
I'll go fix that up by hand :(
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-02 11:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-02 5:15 [PATCH 4.9] media: vivid: check if the cec_adapter is valid Naresh Kamboju
2019-05-02 11:46 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).