pfncount is of type u32 and thus can never be smaller than 0.

Found by the coverity scanner, CID 143213.

Signed-off-by: Tobias Klauser <tklau...@distanz.ch>
---
 drivers/hv/channel.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index 602ca86..17c8689 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -674,8 +674,7 @@ int vmbus_sendpacket_multipagebuffer(struct vmbus_channel 
*channel,
        u32 pfncount = NUM_PAGES_SPANNED(multi_pagebuffer->offset,
                                         multi_pagebuffer->len);
 
-
-       if ((pfncount < 0) || (pfncount > MAX_MULTIPAGE_BUFFER_COUNT))
+       if (pfncount > MAX_MULTIPAGE_BUFFER_COUNT)
                return -EINVAL;
 
        /*
-- 
1.7.9.5


_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to