All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] pci_ep: Fix Coverity warning
@ 2019-07-31  8:04 Ramon Fried
  2019-08-08  3:16 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Ramon Fried @ 2019-07-31  8:04 UTC (permalink / raw)
  To: u-boot

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")

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
---
 drivers/pci_endpoint/pci_ep-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci_endpoint/pci_ep-uclass.c b/drivers/pci_endpoint/pci_ep-uclass.c
index 2f9c70398d..9f53a9a9b9 100644
--- a/drivers/pci_endpoint/pci_ep-uclass.c
+++ b/drivers/pci_endpoint/pci_ep-uclass.c
@@ -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 &&
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH] pci_ep: Fix Coverity warning
  2019-07-31  8:04 [U-Boot] [PATCH] pci_ep: Fix Coverity warning Ramon Fried
@ 2019-08-08  3:16 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-08-08  3:16 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 31, 2019 at 11:04:26AM +0300, Ramon Fried wrote:

> 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")
> 
> Signed-off-by: Ramon Fried <rfried.dev@gmail.com>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-08  3:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31  8:04 [U-Boot] [PATCH] pci_ep: Fix Coverity warning Ramon Fried
2019-08-08  3:16 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.