* [PATCH] media: imx-jpeg: Fix possible null pointer dereference
@ 2021-09-27 18:56 ` Mirela Rabulea
0 siblings, 0 replies; 2+ messages in thread
From: Mirela Rabulea @ 2021-09-27 18:56 UTC (permalink / raw)
To: mchehab, hverkuil-cisco, robert.chiras, laurentiu.palcu
Cc: linux-imx, shawnguo, s.hauer, kernel, festevam, linux-media,
linux-arm-kernel, linux-kernel
Found by Coverity scan.
Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
---
drivers/media/platform/imx-jpeg/mxc-jpeg.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/platform/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/imx-jpeg/mxc-jpeg.c
index 2e1fef88cdf0..b1678f94dccd 100644
--- a/drivers/media/platform/imx-jpeg/mxc-jpeg.c
+++ b/drivers/media/platform/imx-jpeg/mxc-jpeg.c
@@ -576,6 +576,10 @@ static irqreturn_t mxc_jpeg_dec_irq(int irq, void *priv)
dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
+ if (!dst_buf || !src_buf) {
+ dev_err(dev, "No source or destination buffer.\n");
+ goto job_unlock;
+ }
jpeg_src_buf = vb2_to_mxc_buf(&src_buf->vb2_buf);
if (dec_ret & SLOT_STATUS_ENC_CONFIG_ERR) {
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] media: imx-jpeg: Fix possible null pointer dereference
@ 2021-09-27 18:56 ` Mirela Rabulea
0 siblings, 0 replies; 2+ messages in thread
From: Mirela Rabulea @ 2021-09-27 18:56 UTC (permalink / raw)
To: mchehab, hverkuil-cisco, robert.chiras, laurentiu.palcu
Cc: linux-imx, shawnguo, s.hauer, kernel, festevam, linux-media,
linux-arm-kernel, linux-kernel
Found by Coverity scan.
Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
---
drivers/media/platform/imx-jpeg/mxc-jpeg.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/media/platform/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/imx-jpeg/mxc-jpeg.c
index 2e1fef88cdf0..b1678f94dccd 100644
--- a/drivers/media/platform/imx-jpeg/mxc-jpeg.c
+++ b/drivers/media/platform/imx-jpeg/mxc-jpeg.c
@@ -576,6 +576,10 @@ static irqreturn_t mxc_jpeg_dec_irq(int irq, void *priv)
dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
+ if (!dst_buf || !src_buf) {
+ dev_err(dev, "No source or destination buffer.\n");
+ goto job_unlock;
+ }
jpeg_src_buf = vb2_to_mxc_buf(&src_buf->vb2_buf);
if (dec_ret & SLOT_STATUS_ENC_CONFIG_ERR) {
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-27 19:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27 18:56 [PATCH] media: imx-jpeg: Fix possible null pointer dereference Mirela Rabulea
2021-09-27 18:56 ` Mirela Rabulea
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.