Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jul 2018 11:15:20 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336895 - head/sys/dev/xen/blkfront
Message-ID:  <201807301115.w6UBFKo7080381@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Mon Jul 30 11:15:20 2018
New Revision: 336895
URL: https://svnweb.freebsd.org/changeset/base/336895

Log:
  xen-blkfront: fix length check
  
  Length is an unsigned integer, so checking against < 0 doesn't make
  sense. While there also make clear that a length of 0 always succeeds.
  
  Submitted by:		Pratyush Yadav <pratyush@freebsd.org>
  Differential Review:	https://reviews.freebsd.org/D16045

Modified:
  head/sys/dev/xen/blkfront/blkfront.c

Modified: head/sys/dev/xen/blkfront/blkfront.c
==============================================================================
--- head/sys/dev/xen/blkfront/blkfront.c	Mon Jul 30 10:55:02 2018	(r336894)
+++ head/sys/dev/xen/blkfront/blkfront.c	Mon Jul 30 11:15:20 2018	(r336895)
@@ -602,8 +602,8 @@ xbd_dump(void *arg, void *virtual, vm_offset_t physica
 	int sbp;
 	int rc = 0;
 
-	if (length <= 0)
-		return (rc);
+	if (length == 0)
+		return (0);
 
 	xbd_quiesce(sc);	/* All quiet on the western front. */
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807301115.w6UBFKo7080381>