mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-03 21:35:58 +00:00
modem-manager: Fix a segfault on startup for some MBIM-QDU devices
Works around https://github.com/fwupd/fwupd/issues/4190 although we still need to find the root cause.
This commit is contained in:
parent
b728608baa
commit
4329ddbd76
@ -188,6 +188,15 @@ fu_firehose_validate_rawprogram(GBytes *rawprogram,
|
||||
gboolean
|
||||
fu_firehose_updater_open(FuFirehoseUpdater *self, GError **error)
|
||||
{
|
||||
/* sanity check */
|
||||
if (self->port == NULL) {
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"no firehose port provided for filename");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_debug("opening firehose port...");
|
||||
self->io_channel = fu_io_channel_new_file(self->port, error);
|
||||
return (self->io_channel != NULL);
|
||||
|
@ -551,6 +551,15 @@ fu_mm_device_probe(FuDevice *device, GError **error)
|
||||
static gboolean
|
||||
fu_mm_device_io_open_qcdm(FuMmDevice *self, GError **error)
|
||||
{
|
||||
/* sanity check */
|
||||
if (self->port_qcdm == NULL) {
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"no QCDM port provided for filename");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* open device */
|
||||
self->io_channel = fu_io_channel_new_file(self->port_qcdm, error);
|
||||
if (self->io_channel == NULL)
|
||||
@ -695,6 +704,15 @@ fu_mm_device_at_cmd(FuMmDevice *self, const gchar *cmd, gboolean has_response, G
|
||||
static gboolean
|
||||
fu_mm_device_io_open(FuMmDevice *self, GError **error)
|
||||
{
|
||||
/* sanity check */
|
||||
if (self->port_at == NULL) {
|
||||
g_set_error_literal(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_NOT_SUPPORTED,
|
||||
"no AT port provided for filename");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* open device */
|
||||
self->io_channel = fu_io_channel_new_file(self->port_at, error);
|
||||
if (self->io_channel == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user