mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-01-26 06:07:53 +00:00
Apply 3 suggestion(s) to 1 file(s)
Co-authored-by: Barnabás Pőcze <pobrn@protonmail.com>
This commit is contained in:
parent
aac3c14d43
commit
8361526317
@ -320,7 +320,6 @@ static bool is_usb_interface_dir(const char *name)
|
||||
static char *check_wireless_status_at_path(struct impl *this, const char *path)
|
||||
{
|
||||
char wireless_path[PATH_MAX];
|
||||
char *result;
|
||||
int res;
|
||||
|
||||
res = spa_scnprintf(wireless_path, sizeof(wireless_path),
|
||||
@ -331,10 +330,7 @@ static char *check_wireless_status_at_path(struct impl *this, const char *path)
|
||||
if (access(wireless_path, R_OK) < 0)
|
||||
return NULL;
|
||||
|
||||
result = strdup(wireless_path);
|
||||
if (!result)
|
||||
spa_log_error(this->log, "failed to allocate wireless_status path");
|
||||
return result;
|
||||
return strdup(wireless_path);
|
||||
}
|
||||
|
||||
static char *search_siblings_for_wireless_status(struct impl *this, const char *parent_path)
|
||||
@ -424,8 +420,7 @@ static void update_wireless_status(struct impl *this, struct card *card)
|
||||
if (status == WIRELESS_STATUS_UNKNOWN) {
|
||||
spa_log_info(this->log, "card %u wireless_status unreadable, removing monitor",
|
||||
card->card_nr);
|
||||
free(card->wireless_status_path);
|
||||
card->wireless_status_path = NULL;
|
||||
spa_clear_ptr(card->wireless_status_path, free);
|
||||
card->wireless_disconnected = false;
|
||||
return;
|
||||
}
|
||||
@ -1093,8 +1088,7 @@ static struct card *find_card_by_wireless_status_path(struct impl *this, const c
|
||||
return NULL;
|
||||
|
||||
for (unsigned int i = 0; i < this->n_cards; i++) {
|
||||
if (this->cards[i].wireless_status_path &&
|
||||
spa_streq(this->cards[i].wireless_status_path, wireless_path))
|
||||
if (spa_streq(this->cards[i].wireless_status_path, wireless_path))
|
||||
return &this->cards[i];
|
||||
}
|
||||
return NULL;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user