Skip to contentSkip to conversation

pci_ep: Fix Coverity warning

PATCH New Ramon Fried 2 participants 2 messages Jul 31, 2019 – Aug 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci_ep: Fix Coverity warning

Fix the following Coverity warning:
CID 244086: Incorrect expression (BAD_COMPARE) Comparing pointer "ep_bar" against NULL using anything besides == or is likely to be incorrect.

Fixes 914026d25848 ("drivers: pci_ep: Introduce UCLASS_PCI_EP uclass")
---
 drivers/pci_endpoint/pci_ep-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci_endpoint/pci_ep-uclass.c +1 -1
index 2f9c70398d..9f53a9a9b9 100644
@@ -43,7 +43,7 @@ int pci_ep_set_bar(struct udevice *dev, uint func_no, struct pci_bar *ep_bar)
 	int flags = ep_bar->flags;
 
 	/* Some basic bar validity checks */
-	if (ep_bar->barno > BAR_5 || ep_bar < BAR_0)
+	if (ep_bar->barno > BAR_5 || ep_bar->barno < BAR_0)
 		return -EINVAL;
 
 	if ((ep_bar->barno == BAR_5 &&
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 pci_ep: Fix Coverity warning

Quoted 8 lines · Ramon Fried

Fix the following Coverity warning:
CID 244086: Incorrect expression (BAD_COMPARE) Comparing pointer "ep_bar" against NULL using anything besides == or is likely to be incorrect.

Fixes 914026d25848 ("drivers: pci_ep: Introduce UCLASS_PCI_EP uclass")

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190807/1eb7e0f1/attachment.sig>