Re: [PATCH v3] PCI: endpoint: Fix NULL pointer dereference for ->get_features()

2021-01-06 Thread Leon Romanovsky
On Wed, Jan 06, 2021 at 04:08:10PM +0530, Shradha Todi wrote: > get_features ops of pci_epc_ops may return NULL, causing NULL pointer > dereference in pci_epf_test_bind function. Let us add a check for > pci_epc_feature pointer in pci_epf_test_bind before we access it to avoid > any such NULL

[PATCH v3] PCI: endpoint: Fix NULL pointer dereference for ->get_features()

2021-01-06 Thread Shradha Todi
get_features ops of pci_epc_ops may return NULL, causing NULL pointer dereference in pci_epf_test_bind function. Let us add a check for pci_epc_feature pointer in pci_epf_test_bind before we access it to avoid any such NULL pointer dereference and return -ENOTSUPP in case pci_epc_feature is not