[libvirt] [PATCH] event: don't queue NULL event on OOM

Eric Blake eblake at redhat.com
Fri Jan 10 03:32:31 UTC 2014

On 01/09/2014 08:25 PM, John Ferlan wrote:
> On 01/09/2014 10:22 PM, Eric Blake wrote:
>> Ever since commit 61ac8ce, Coverity complained about
>> remoteNetworkBuildEventLifecycle not checking for NULL failure
>> to build an event, compared to other calls in the code base.

>> I don't know if this will actually shut up Coverity, or if we
>> have to modify all 17 calls to remoteEventQueue to do the NULL
>> check there.  I'm hoping this simpler solution does the trick.
>>  src/remote/remote_driver.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)

You can't have finished a Coverity run that fast!  But here's hoping it
works (and re-reading the original Coverity report, I think it will):

> (15) Event dereference: 	Dereferencing a pointer that might be null "event" when calling "remoteDomainEventQueue(struct private_data *, virObjectEventPtr)". [details]
> Also see events: 	[returned_null][example_assign][example_checked][example_assign][example_checked][example_assign][example_checked][example_assign][example_checked][example_assign][example_checked][var_assigned]

so Coverity is already smart enough to trace the flow from *BuildEvent*
to remoteDomainEventQueue() to the non-null parameter of
virObjectEventStateQueue().  So I pushed.

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140109/0ecbed78/attachment-0001.sig>

More information about the libvir-list mailing list