mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-07 21:45:04 +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
|
gboolean
|
||||||
fu_firehose_updater_open(FuFirehoseUpdater *self, GError **error)
|
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...");
|
g_debug("opening firehose port...");
|
||||||
self->io_channel = fu_io_channel_new_file(self->port, error);
|
self->io_channel = fu_io_channel_new_file(self->port, error);
|
||||||
return (self->io_channel != NULL);
|
return (self->io_channel != NULL);
|
||||||
|
@ -551,6 +551,15 @@ fu_mm_device_probe(FuDevice *device, GError **error)
|
|||||||
static gboolean
|
static gboolean
|
||||||
fu_mm_device_io_open_qcdm(FuMmDevice *self, GError **error)
|
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 */
|
/* open device */
|
||||||
self->io_channel = fu_io_channel_new_file(self->port_qcdm, error);
|
self->io_channel = fu_io_channel_new_file(self->port_qcdm, error);
|
||||||
if (self->io_channel == NULL)
|
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
|
static gboolean
|
||||||
fu_mm_device_io_open(FuMmDevice *self, GError **error)
|
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 */
|
/* open device */
|
||||||
self->io_channel = fu_io_channel_new_file(self->port_at, error);
|
self->io_channel = fu_io_channel_new_file(self->port_at, error);
|
||||||
if (self->io_channel == NULL)
|
if (self->io_channel == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user