Date: Mon, 28 Nov 2016 06:53:00 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309236 - head/sys/dev/hyperv/vmbus Message-ID: <201611280653.uAS6r0O8025920@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Mon Nov 28 06:53:00 2016 New Revision: 309236 URL: https://svnweb.freebsd.org/changeset/base/309236 Log: hyperv/vmbus: Make sure that the allocated GPADL is not zero. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8631 Modified: head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 06:40:26 2016 (r309235) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 06:53:00 2016 (r309236) @@ -325,7 +325,13 @@ vmbus_msghc_wakeup(struct vmbus_softc *s uint32_t vmbus_gpadl_alloc(struct vmbus_softc *sc) { - return atomic_fetchadd_int(&sc->vmbus_gpadl, 1); + uint32_t gpadl; + +again: + gpadl = atomic_fetchadd_int(&sc->vmbus_gpadl, 1); + if (gpadl == 0) + goto again; + return (gpadl); } static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611280653.uAS6r0O8025920>