Commit a231707
PCI: keystone: Fix NULL pointer dereference in case of DT error in ks_pcie_setup_rc_app_regs()
If IORESOURCE_MEM is not provided in Device Tree due to
any error, resource_list_first_type() will return NULL and
pci_parse_request_of_pci_ranges() will just emit a warning.
This will cause a NULL pointer dereference. Fix this bug by adding NULL
return check.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 0f71c60 ("PCI: dwc: Remove storing of PCI resources")
Link: https://lore.kernel.org/linux-pci/20240505061517.11527-1-amishin@t-argos.ru
Suggested-by: Bjorn Helgaas <helgaas@kernel.org>
Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>1 parent 9ffa0e7 commit a231707
1 file changed
+15
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | | - | |
| 409 | + | |
410 | 410 | | |
| 411 | + | |
411 | 412 | | |
412 | 413 | | |
413 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
414 | 419 | | |
415 | 420 | | |
416 | 421 | | |
| |||
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
424 | | - | |
| 429 | + | |
425 | 430 | | |
426 | 431 | | |
427 | 432 | | |
| |||
438 | 443 | | |
439 | 444 | | |
440 | 445 | | |
| 446 | + | |
| 447 | + | |
441 | 448 | | |
442 | 449 | | |
443 | 450 | | |
| |||
798 | 805 | | |
799 | 806 | | |
800 | 807 | | |
801 | | - | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
802 | 812 | | |
803 | 813 | | |
804 | 814 | | |
| |||
0 commit comments