[bug report] drm/panfrost: Add support for devcoredump

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

 



Hello Adrián Larumbe,

The patch 730c2bf4ad39: "drm/panfrost: Add support for devcoredump"
from Jul 29, 2022 (linux-next), leads to the following Smatch static
checker warning:

	drivers/gpu/drm/panfrost/panfrost_dump.c:226 panfrost_core_dump()
	warn: 'page' isn't an ERR_PTR

drivers/gpu/drm/panfrost/panfrost_dump.c
    223                 for_each_sgtable_page(bo->base.sgt, &page_iter, 0) {
    224                         struct page *page = sg_page_iter_page(&page_iter);
    225 
--> 226                         if (!IS_ERR(page)) {
                                    ^^^^^^^^^^^^^
I think this check is unnecessary.  Most callers don't check.  Only one
other caller does check which is rvt_reg_user_mr() and it assumes that
sg_page_iter_page() returns NULL on error.

    227                                 *bomap++ = page_to_phys(page);
    228                         } else {
    229                                 dev_err(pfdev->dev, "Panfrost Dump: wrong page\n");
    230                                 *bomap++ = 0;
    231                         }
    232                 }
    233 
    234                 iter.hdr->bomap.iova = mapping->mmnode.start << PAGE_SHIFT;
    235 
    236                 vaddr = map.vaddr;
    237                 memcpy(iter.data, vaddr, bo->base.base.size);
    238 
    239                 drm_gem_vunmap_unlocked(&bo->base.base, &map);
    240 
    241                 iter.hdr->bomap.valid = 1;
    242 
    243 dump_header:        panfrost_core_dump_header(&iter, PANFROSTDUMP_BUF_BO, iter.data +

regards,
dan carpenter



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux