On Tue, Jun 26, 2018 at 09:10:07AM +0800, kernel test robot wrote:
> 
> Greetings,
> 
> 0day kernel testing robot got the below dmesg and the first bad commit is
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> 
> commit ef1433f717a2c63747a519d86965d73ff9bd08b3
> Author:     Kishon Vijay Abraham I <[email protected]>
> AuthorDate: Mon Apr 2 18:59:35 2018 +0530
> Commit:     Lorenzo Pieralisi <[email protected]>
> CommitDate: Fri May 18 16:40:50 2018 +0100
> 
>     PCI: endpoint: Create configfs entry for each pci_epf_device_id table 
> entry
>     
>     In order to be able to provide correct driver_data for pci_epf device,
>     a separate configfs entry for each pci_epf_device_id table entry in
>     pci_epf_driver is required.
>     
>     Add support to create configfs entry for each pci_epf_device_id
>     table entry here.
>     
>     Signed-off-by: Kishon Vijay Abraham I <[email protected]>
>     Signed-off-by: Lorenzo Pieralisi <[email protected]>
>     Tested-by: Gustavo Pimentel <[email protected]>

>From the .config below:

  # CONFIG_PCI_ENDPOINT_CONFIGFS is not set

>From include/linux/pci-ep-cfs.h:

  #ifdef CONFIG_PCI_ENDPOINT_CONFIGFS
  ...
  #else
  static inline struct config_group *pci_ep_cfs_add_epf_group(const char *name)
  {
        return 0;
  }

>From ef1433f717a2:

  +       id = driver->id_table;
  +       while (id->name[0]) {
  +               group = pci_ep_cfs_add_epf_group(id->name);
  +               mutex_lock(&pci_epf_mutex);
  +               list_add_tail(&group->group_entry, &driver->epf_group);

Obviously group == 0 and the list_add_tail() is a NULL pointer
dereference.

Looks like we need either some sort of #ifdef CONFIG_PCI_ENDPOINT_CONFIGFS
in __pci_epf_register_driver() and pci_epf_unregister_driver(), or
higher-level interfaces and corresponding stubs that add/remove all
the IDs.

Bjorn

Reply via email to