Message ID | 20230725130024.568452-1-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | media: nxp: fix wrong return pointer check in mxc_isi_crossbar_init() | expand |
Hi Yang, On Tue, Jul 25, 2023 at 10:03 AM Yang Yingliang <yangyingliang@huawei.com> wrote: > > It should check 'xbar->inputs', when allocate memory for it. > > Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver") > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
Hi Yang, Thank you for the patch. On Tue, Jul 25, 2023 at 09:00:24PM +0800, Yang Yingliang wrote: > It should check 'xbar->inputs', when allocate memory for it. > > Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver") I'll add Cc: stable@vger.kernel.org > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c > index f7447b2f4d77..9fcfc3925733 100644 > --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c > +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c > @@ -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; > }
diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c index f7447b2f4d77..9fcfc3925733 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c @@ -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; }
It should check 'xbar->inputs', when allocate memory for it. Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- drivers/media/platform/nxp/imx8-isi/imx8-isi-crossbar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)