From owner-svn-src-head@freebsd.org Mon Jul 30 11:15:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17F121052D1E; Mon, 30 Jul 2018 11:15:21 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2005944AA; Mon, 30 Jul 2018 11:15:20 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F56823921; Mon, 30 Jul 2018 11:15:20 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6UBFK0r080382; Mon, 30 Jul 2018 11:15:20 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6UBFKo7080381; Mon, 30 Jul 2018 11:15:20 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201807301115.w6UBFKo7080381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Mon, 30 Jul 2018 11:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336895 - head/sys/dev/xen/blkfront X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/dev/xen/blkfront X-SVN-Commit-Revision: 336895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 11:15:21 -0000 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 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. */