]> git.hungrycats.org Git - linux/commitdiff
media: nxp: Fix wrong return pointer check in mxc_isi_crossbar_init()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 25 Jul 2023 13:00:24 +0000 (21:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:48:40 +0000 (09:48 +0200)
commit 4b60db99babad0254129ddc58e0927ffa9e93e35 upstream.

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

Cc: stable@vger.kernel.org
Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c

index b5ffde46f31b61fd9675e022a60fa27ecef92f51..641c802adcc33d16e133c286b5ef01dadf783e4a 100644 (file)
@@ -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;
        }