[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a4059c30-b660-cad4-4c5d-3b100ac164bf@collabora.com>
Date: Fri, 15 Apr 2022 00:11:18 +0300
From: Dmitry Osipenko <dmitry.osipenko@...labora.com>
To: Ashish Mhetre <amhetre@...dia.com>, digetx@...il.com,
krzysztof.kozlowski@...aro.org, thierry.reding@...il.com,
jonathanh@...dia.com, robh+dt@...nel.org,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-tegra@...r.kernel.org, krzysztof.kozlowski+dt@...aro.org
Cc: vdumpa@...dia.com, Snikam@...dia.com
Subject: Re: [Patch v7 1/4] memory: tegra: Add memory controller channels
support
On 4/13/22 12:40, Ashish Mhetre wrote:
>
> +static int tegra186_mc_map_regs(struct tegra_mc *mc)
> +{
> + struct platform_device *pdev = to_platform_device(mc->dev);
> + int i;
> +
> + mc->bcast_ch_regs = devm_platform_ioremap_resource_byname(pdev, "broadcast");
> + if (IS_ERR(mc->bcast_ch_regs)) {
> + if (PTR_ERR(mc->bcast_ch_regs) == -EINVAL) {
> + dev_warn(&pdev->dev, "Broadcast channel is missing, please update your device-tree\n");
> + return 0;
> + }
> + return PTR_ERR(mc->bcast_ch_regs);
> + }
> +
> + mc->ch_regs = devm_kcalloc(mc->dev, mc->soc->num_channels,
> + sizeof(void __iomem *), GFP_KERNEL);
> + if (!mc->ch_regs)
> + return -ENOMEM;
> +
> + for (i = 0; i < mc->soc->num_channels; i++) {
> + char name[4];
> +
> + sprintf(name, "ch%u", i);
name[5], otherwise you corrupting stack. Use snprintf(name, sizeof(name)).
Powered by blists - more mailing lists