Skip to contentSkip to conversation

media: nxp: fix wrong return pointer check in mxc_isi_crossbar_init()

PATCH In review Yang Yingliang 3 participants 3 messages Jul 25, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: nxp: fix wrong return pointer check in mxc_isi_crossbar_init()

It should check 'xbar->inputs', when allocate memory for it.

Fixes cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")
---
 drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +1 -1
index f7447b2f4d77..9fcfc3925733 100644
@@ -483,7 +483,7 @@ int mxc_isi_crossbar_init(struct mxc_isi_dev *isi)
 
 	xbar->inputs = kcalloc(xbar->num_sinks, sizeof(*xbar->inputs),
 			       GFP_KERNEL);
-	if (!xbar->pads) {
+	if (!xbar->inputs) {
 		ret = -ENOMEM;
 		goto err_free;
 	}
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Yang Yingliang

Hi Yang,

Thank you for the patch.

Quoted 3 lines · Yang Yingliang

It should check 'xbar->inputs', when allocate memory for it.

Fixes cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")

I'll add

Quoted 1 line
Quoted 17 lines
---
 drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +1 -1
index f7447b2f4d77..9fcfc3925733 100644
@@ -483,7 +483,7 @@ int mxc_isi_crossbar_init(struct mxc_isi_dev *isi)
 
 	xbar->inputs = kcalloc(xbar->num_sinks, sizeof(*xbar->inputs),
 			       GFP_KERNEL);
-	if (!xbar->pads) {
+	if (!xbar->inputs) {
 		ret = -ENOMEM;
 		goto err_free;
 	}
Signature · 3 lines
Regards,

Laurent Pinchart