Merge pull request #3265 from yuyuyu101/coverify-fix

Event: Avoid illegal multiplication for memset

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2014-12-29 10:56:23 -08:00
commit d54295e5a8

View File

@ -120,7 +120,7 @@ int EventCenter::create_file_event(int fd, int mask, EventCallbackRef ctxt)
lderr(cct) << __func__ << " failed to realloc file_events" << cpp_strerror(errno) << dendl;
return -errno;
}
memset(file_events+sizeof(FileEvent)*nevent, 0, sizeof(FileEvent)*(new_size-nevent));
memset(file_events+nevent, 0, sizeof(FileEvent)*(new_size-nevent));
file_events = new_events;
nevent = new_size;
}