[bug report] PCI: endpoint: Automatically create a function specific attributes group

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

 



Hello Damien Le Moal,

The patch 01c68988addf: "PCI: endpoint: Automatically create a
function specific attributes group" from Apr 15, 2023, leads to the
following Smatch static checker warning:

	drivers/pci/endpoint/pci-ep-cfs.c:540 pci_ep_cfs_add_type_group()
	warn: 'group' isn't an ERR_PTR

drivers/pci/endpoint/pci-ep-cfs.c
    532 static void pci_ep_cfs_add_type_group(struct pci_epf_group *epf_group)
    533 {
    534         struct config_group *group;
    535 
    536         group = pci_epf_type_add_cfs(epf_group->epf, &epf_group->group);
    537         if (!group)
    538                 return;
    539 
--> 540         if (IS_ERR(group)) {

pci_epf_type_add_cfs() does not return error pointers currently.  Which
is fine.  Presumably it will start returning them later.  But could you
add some comments next to the pci_epf_type_add_cfs() to explain what a
NULL return means vs an error pointer return?

    541                 dev_err(&epf_group->epf->dev,
    542                         "failed to create epf type specific attributes\n");
    543                 return;
    544         }
    545 
    546         configfs_register_group(&epf_group->group, group);
    547 }

regards,
dan carpenter



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux