bluez5: Test transport pointer before using it

If this->transport is NULL the debug log will crash.
This commit is contained in:
Frédéric Danis 2022-08-18 12:57:04 +02:00
parent 0532d194ad
commit 6b3390387d

View file

@ -721,13 +721,13 @@ static int do_start(struct impl *this)
if (this->started) if (this->started)
return 0; return 0;
spa_return_val_if_fail(this->transport != NULL, -EIO);
this->following = is_following(this); this->following = is_following(this);
spa_log_debug(this->log, "%p: start state:%d following:%d", spa_log_debug(this->log, "%p: start state:%d following:%d",
this, this->transport->state, this->following); this, this->transport->state, this->following);
spa_return_val_if_fail(this->transport != NULL, -EIO);
if (this->transport->state >= SPA_BT_TRANSPORT_STATE_PENDING || if (this->transport->state >= SPA_BT_TRANSPORT_STATE_PENDING ||
this->is_duplex) this->is_duplex)
res = transport_start(this); res = transport_start(this);