From: Eric Blake Date: Mon, 1 Mar 2010 18:59:43 +0000 (-0700) Subject: libvirtd: avoid false-positive NULL-deref warning from clang X-Git-Tag: v0.7.7~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=66d70a8f66765a87c4ab5a11567f99e72aea7de4;p=thirdparty%2Flibvirt.git libvirtd: avoid false-positive NULL-deref warning from clang * daemon/libvirtd.c (qemudWorker): Rewrite loop to silence a warning. --- diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 9bdbecb779..b44d9b4e8f 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -1502,16 +1502,15 @@ static void *qemudWorker(void *data) struct qemud_client_message *msg; virMutexLock(&server->lock); - while (((client = qemudPendingJob(server)) == NULL) && - !worker->quitRequest) { - if (virCondWait(&server->job, &server->lock) < 0) { + while ((client = qemudPendingJob(server)) == NULL) { + if (worker->quitRequest || + virCondWait(&server->job, &server->lock) < 0) { virMutexUnlock(&server->lock); return NULL; } } if (worker->quitRequest) { - if (client) - virMutexUnlock(&client->lock); + virMutexUnlock(&client->lock); virMutexUnlock(&server->lock); return NULL; }