mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
manager: improve error checking in modem_reset()
This commit is contained in:
@@ -121,7 +121,7 @@ static gboolean modem_reset_done(struct EG25Manager* manager)
|
||||
|
||||
void modem_reset(struct EG25Manager *manager)
|
||||
{
|
||||
int fd, ret, len = strlen(manager->modem_usb_id);
|
||||
int fd, ret, len;
|
||||
|
||||
if (manager->reset_timer)
|
||||
return;
|
||||
@@ -131,6 +131,13 @@ void modem_reset(struct EG25Manager *manager)
|
||||
manager->suspend_timer = 0;
|
||||
}
|
||||
|
||||
if (!manager->modem_usb_id) {
|
||||
g_warning("Unknown modem USB ID");
|
||||
goto error;
|
||||
}
|
||||
|
||||
len = strlen(manager->modem_usb_id);
|
||||
|
||||
manager->modem_state = EG25_STATE_RESETTING;
|
||||
|
||||
fd = open("/sys/bus/usb/drivers/usb/unbind", O_WRONLY);
|
||||
|
Reference in New Issue
Block a user