changelog: fix br-state-check.t crash for brick_mux
Problem: br-state-check.t is getting crash Solution: Check condition in rpcsvc_request_create before allocate memory from rxpool BUG: 1597776 Change-Id: I4fde1ade6073f603c32453f1840395db9a9155b7 fixes: bz#1597776 Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
This commit is contained in:
parent
f4497ee445
commit
e31c7a7c0c
@ -458,7 +458,7 @@ rpcsvc_request_create (rpcsvc_t *svc, rpc_transport_t *trans,
|
||||
size_t msglen = 0;
|
||||
int ret = -1;
|
||||
|
||||
if (!svc || !trans)
|
||||
if (!svc || !trans || !svc->rxpool)
|
||||
return NULL;
|
||||
|
||||
/* We need to allocate the request before actually calling
|
||||
@ -1585,6 +1585,7 @@ rpcsvc_get_listener (rpcsvc_t *svc, uint16_t port, rpc_transport_t *trans)
|
||||
{
|
||||
rpcsvc_listener_t *listener = NULL;
|
||||
char found = 0;
|
||||
rpcsvc_listener_t *next = NULL;
|
||||
uint32_t listener_port = 0;
|
||||
|
||||
if (!svc) {
|
||||
@ -1593,7 +1594,7 @@ rpcsvc_get_listener (rpcsvc_t *svc, uint16_t port, rpc_transport_t *trans)
|
||||
|
||||
pthread_rwlock_rdlock (&svc->rpclock);
|
||||
{
|
||||
list_for_each_entry (listener, &svc->listeners, list) {
|
||||
list_for_each_entry_safe (listener, next, &svc->listeners, list) {
|
||||
if (trans != NULL) {
|
||||
if (listener->trans == trans) {
|
||||
found = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user