Commit Graph

8138 Commits

Author SHA1 Message Date
Richard Hughes
4b16f66948 trivial: Check for impossible NULL child before dereferencing
PVS
2022-09-09 19:23:29 +01:00
Richard Hughes
af3d1116f6 parade-lspcon: Remove trivial dead init
PVS: The 'write_data[0]' variable was assigned the same value.
2022-09-09 19:23:29 +01:00
Richard Hughes
e6e476a0e7 emmc: Use struct init to set mmc_ioc_cmd
PVS: The 'idata.write_flag' variable was assigned the same value.
2022-09-09 19:23:29 +01:00
Richard Hughes
67a0812b92 logitech-hidpp: Fix debug text when getting a HIDPP error message
PVS: Two or more case-branches perform the same actions.
2022-09-09 19:23:29 +01:00
Richard Hughes
01994a993a trivial: Fix impossible crash when the firmware search path is NULL
PVS: The 'contents' pointer was used unsafely after it was verified against nullptr.
2022-09-09 19:23:29 +01:00
Richard Hughes
6bb1b1c81f trivial: Fix a BIOS setting self test value
PVS: The 'ret' variable is assigned but is not used by the end of the function.
2022-09-09 19:23:29 +01:00
Richard Hughes
9ab03d586e Fix aligning up addresses greater than 4GB
PVS: The size of the bit mask is less than the size of the first operand.
2022-09-09 19:23:29 +01:00
Richard Hughes
aa71485cc5 trivial: Fix a few theoretical memory leaks that can't happen in reality
PVS: The function was exited without releasing the 'str' pointer.
2022-09-09 19:23:29 +01:00
Richard Hughes
e84e8b6927 redfish: Use the passed offset when parsing SMBIOS tables
PVS: Parameter 'offset' is always rewritten in function body before being used.
2022-09-09 19:23:29 +01:00
Richard Hughes
c3851c82c8 trivial: Remove duplicate line
PVS: Two identical blocks of text were found.
2022-09-09 19:23:29 +01:00
Richard Hughes
a74e383f8d synaptics-cxaudio: Use fu_strtobool() to parse TRUE and FALSE
PVS: Converting type 'guint64' to type 'gboolean' can lead to a loss of high-order bits.
2022-09-09 19:23:29 +01:00
Richard Hughes
f49d5ed10c trivial: Fix invalid printf() usage
PVS: The line being passed could contain format specification.
2022-09-09 19:23:29 +01:00
Richard Hughes
76138349e2 Fix a potential critical warning when parsing firmware
PVS: The 'filename' pointer was utilized before it was verified against nullptr.
2022-09-09 19:23:29 +01:00
Richard Hughes
890a48045e trivial: Remove a duplicate line
The conditional expressions of the 'if' statements situated alongside each other are identical.
2022-09-09 19:23:29 +01:00
Richard Hughes
5014c87a2a trivial: Remove a condition that can never be non-valid
PVS: A part of conditional expression is always true: priv->children->len > 0.
2022-09-09 19:23:29 +01:00
Richard Hughes
72f6cc5a0a redfish: Fix a condition that can never be false
PVS: A part of conditional expression is always true: path != NULL.
2022-09-09 19:23:29 +01:00
Richard Hughes
08a9f02912 Use the correct JSON type for fwupd_bios_setting_from_json()
PVS: Converting type 'gint64' to type 'gboolean' can lead to a loss of high-order bits.
2022-09-09 19:23:29 +01:00
Richard Hughes
d88e6b4a1e trivial: Relax the requirement that fu_firmware_set_bytes() can only be called once
PVS: Expression 'priv->bytes != NULL' is always false.
2022-09-09 19:23:29 +01:00
Richard Hughes
5e3a601da9 trivial: Remove a useless g_return_val_if_fail()
PVS: Expression 'sender != NULL' is always true.
2022-09-09 19:23:29 +01:00
Richard Hughes
6a5eda0a44 trivial: Use G_GSSIZE_FORMAT in more places 2022-09-09 19:23:29 +01:00
Richard Hughes
908c1d8c02 modem-manager: Do not print (null)
PVS: Incorrect format. A null pointer is used.
2022-09-09 19:23:29 +01:00
Richard Hughes
ab5683deb0 emmc: Do not print (null)
PVS: Incorrect format. A null pointer is used.
2022-09-09 19:23:29 +01:00
Richard Hughes
f79572891b cros-ec: Fix trivial format specifier
PVS: The size_t type argument is expected.
2022-09-09 19:23:29 +01:00
Richard Hughes
425f1a70c7 dell-dock: Remove trivial duplicate line 2022-09-09 19:23:29 +01:00
Richard Hughes
0c80952e30 synaptics-mst: Check the firmware payload size when updating cayenne
PVS: Parameter 'payload_len' is always rewritten in function body before being used.
2022-09-09 19:22:58 +01:00
Richard Hughes
07b368d6b1 vbe: Fix a crash when dumping firmware
PVS: The null pointer is passed into 'g_byte_array_append' function.
2022-09-09 18:50:56 +01:00
Dylan Van Assche
c62e7a6bab android-boot: fix segfault
Store strings during the lifetime of the plugin and free them
when destroyed.
2022-09-09 16:16:50 +01:00
Richard Hughes
5f554d1668 ccgx: Write all the metadata block as intended
PVS: It's odd that 'sizeof()' operator evaluates the size of a pointer to a
class, but not the size of the 'metadata' class object.
2022-09-09 06:42:51 -05:00
Richard Hughes
aaf1f21dd3 Limit the archive size to 25% of the RAM, or 4G
PVS: Expression is always false
2022-09-09 06:12:14 -05:00
Mario Limonciello
f5d51d80eb trivial: fix container generation 2022-09-08 23:18:22 -05:00
Richard Hughes
80608dcac9 Allow setting the FuFirmware size when building firmware 2022-09-08 08:55:51 -05:00
Mario Limonciello
684c663dee trivial: add goshen ridge nvm version parsing 2022-09-08 09:56:33 +01:00
Richard Hughes
5ebc3b6ad9 Move the generic Intel Goshen Ridge code out to a new plugin
The original code was written by Dell for the dell-dock plugin, but
it's exactly the same code and NVM format for Intel reference hardware.
2022-09-08 09:56:33 +01:00
Richard Hughes
fc3ac81978 Load coSWID metadata from a uSWID MTD block device
The coSWID is a child of the parent, and the parent container does not have a
version. Also fix a small memory leak when parsing container formats.

Fixes https://github.com/fwupd/fwupd/issues/4294
2022-09-07 16:02:27 +01:00
Richard Hughes
c43b981d63 Fix parsing uSWID uncompressed metadata
The magic offset is not required as we're working on a pre-offset GBytes.
2022-09-07 16:02:27 +01:00
Richard Hughes
9e3bd17c70 Fix parsing the coSWID firmware ID when encoded as a UUID 2022-09-07 16:02:27 +01:00
Richard Hughes
1d308b2361 trivial: Export fu_device_set_quirk_kv() for future use
This seems like a useful thing regardless.
2022-09-07 14:43:08 +01:00
Mario Limonciello
b0ccde5b27 trivial: add libumock-dev into debian/control 2022-09-07 08:33:02 -05:00
Mario Limonciello
eb8e527a6c trivial: debian: drop libglib2.0-doc package
We don't need a documentation package to build fwupd.
2022-09-07 08:33:02 -05:00
Mario Limonciello
c598f27eab trivial: make sure libfdt-dev is in debian/control 2022-09-07 08:33:02 -05:00
Mario Limonciello
e3979f5da6 trivial: debian: don't populate dependencies without <control>
clang-format isn't needed to build fwupd, but it is needed for
contributors to pass CI.
2022-09-07 08:33:02 -05:00
Mario Limonciello
d6a455e856 trivial: try harder to make sure mtdram is set up
the autopkgtest environment in Ubuntu seems to not be preparing the mtdram
device properly. Sometimes the udev node "exists" but the /dev/mtd0 does not
exist.

Look for this explicitly and skip the test if it happens.
2022-09-07 08:24:10 -05:00
Mario Limonciello
aebf33c4f6 trivial: libfwupdplugin: fix an error return string 2022-09-07 08:24:10 -05:00
Mario Limonciello
cc8b4905ef trivial: only build thunderbolt for x86 architectures
It's true that the USB4 spec won't require x86, but a recent autopkgtest
failure on powerpc doesn't make sense to debug.  You won't ever see TBT
in a powerpc machine.

We can loosen this to any non-x86 architectures later that DO prove to
have support for USB4 add-in cards.
2022-09-07 08:05:08 -05:00
Richard Hughes
f9de0ee2f9 android-boot: Quirk data is available as soon as the instance ID has been added 2022-09-06 21:28:58 +01:00
Richard Hughes
0b8640929c android-boot: Only add the device if updatable
Otherwise we get devices like:

    ├─EFI\x20system\x20partition:
    │     Device ID:          003a0352e13dc2defe8548eb541d56067e5e5d71
    │     Summary:            Android Bootloader
    │     Current version:    0.0.0
    │     GUIDs:              a4001789-0ca9-5f4c-8c53-e65f8ec8a825
    │                         9d825eae-ef58-501c-944f-6a0a8d9cfb49
    │     Device Flags:       • Internal device
    │                         • System requires external power source
    │                         • Needs a reboot after installation
    │                         • Cryptographic hash verification is available
2022-09-06 21:28:58 +01:00
Richard Hughes
26e029756c android-boot: Don't set the GError if not checking return code 2022-09-06 21:28:58 +01:00
Richard Hughes
ce014ccf65 trivial: Fix a tiny memory leak when loading BIOS settings 2022-09-06 21:23:44 +01:00
Richard Hughes
89c16bfb2a Only parse the ARC_PARAMS section of the NVM if provided
The thunderbolt plugin reads in 0x80 bytes if we just want to know if a
firmware is native, and 0x224 if we just want the DIGITAL section. The reason
we do this is that reading the entire NVM is really slow.

If we can see the firmware is smaller than the ARC section, read all the
expected data and return success without adding a payload.
2022-09-06 20:45:38 +01:00
Richard Hughes
39b931938f trivial: Allow parsing thunderbolt-nvm images from fwupdtool 2022-09-06 20:45:38 +01:00