[bug report] drm/tegra: Add NVDEC driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Mikko Perttunen,

The patch 46f226c93d35: "drm/tegra: Add NVDEC driver" from Sep 16,
2021, leads to the following Smatch static checker warning:

	drivers/gpu/drm/tegra/nvdec.c:282 nvdec_load_falcon_firmware()
	error: uninitialized symbol 'iova'.

drivers/gpu/drm/tegra/nvdec.c
    253 static int nvdec_load_falcon_firmware(struct nvdec *nvdec)
    254 {
    255         struct host1x_client *client = &nvdec->client.base;
    256         struct tegra_drm *tegra = nvdec->client.drm;
    257         dma_addr_t iova;
    258         size_t size;
    259         void *virt;
    260         int err;
    261 
    262         if (nvdec->falcon.firmware.virt)
    263                 return 0;
    264 
    265         err = falcon_read_firmware(&nvdec->falcon, nvdec->config->firmware);
    266         if (err < 0)
    267                 return err;
    268 
    269         size = nvdec->falcon.firmware.size;
    270 
    271         if (!client->group) {
    272                 virt = dma_alloc_coherent(nvdec->dev, size, &iova, GFP_KERNEL);
    273 
    274                 err = dma_mapping_error(nvdec->dev, iova);
    275                 if (err < 0)
    276                         return err;
    277         } else {
    278                 virt = tegra_drm_alloc(tegra, size, &iova);
                                                             ^^^^
Needs an if (IS_ERR(virt)) {

No idea why this warning is only just showing up now after two years...

    279         }
    280 
    281         nvdec->falcon.firmware.virt = virt;
--> 282         nvdec->falcon.firmware.iova = iova;
    283 

regards,
dan carpenter



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux