summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-11-19fs/squashfs: sqfs_read: fix another memory leakRichard Genoud
data_buffer was allocated in a loop and freed only once. Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_read: fix memory leakRichard Genoud
sqfs_closedir() should be called to free memory allocated by sqfs_opendir() Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com> Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_read: remove useless sqfs_closedir()Richard Genoud
as sqfs_opendir failed, there's no need to call sqfs_closedir Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_read: fix dangling pointer dirs->entryRichard Genoud
dirs->entry shouldn't be left dangling as it could be freed twice. Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_size: remove useless sqfs_closedir()Richard Genoud
as sqfs_opendir failed, there's no need to call sqfs_closedir Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_size: fix dangling pointer dirs->entryRichard Genoud
dirs->entry shouldn't be left dangling as it could be freed twice. Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_concat_tokens: check if malloc succeedsRichard Genoud
memory allocation should always be checked Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com> Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_read_inode_table: fix dangling pointerRichard Genoud
inode_table should not be left dangling as it may be freed in sqfs_opendir Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_search_dir: fix memory leaksRichard Genoud
path, target, res, rem and sym_tokens were not free on error nor success. Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com> Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_search_dir: fix dangling pointerRichard Genoud
dirs->entry shouldn't be left dangling as it could be freed twice. Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_read_directory_table: fix memory leakRichard Genoud
pos_list wasn't freed on every error Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com> Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_split_path: fix memory leak and dangling pointersRichard Genoud
*file and *dir were not freed on error Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com> Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_closedir: fix memory leakRichard Genoud
sqfs_dirs wasn't freed anywhere. Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com> Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_opendir: simplify error handlingRichard Genoud
Using only one label permits to prevents bugs when moving code around. Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com> Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: sqfs_opendir: fix some memory leaks and dangling pointersRichard Genoud
When trying to load an non-existing file, the cpu hangs! Signed-off-by: Richard Genoud <richard.genoud@posteo.net>
2020-11-19fs/squashfs: fix board hang-up when calling .exists()Richard Genoud
add missing squashfs function to prevent dangling or null pointers. For exemple, when calling test [ -e somefile ], squashfs.exists may be called. Signed-off-by: Richard Genoud <richard.genoud@posteo.net> Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
2020-11-19fs: btrfs: initialize @ret to 0 to prevent uninitialized return valueQu Wenruo
In show_dir() if we hit a ROOT_ITEM, we can exit with uninitialized @ret. Fix it by initializing it to 0. Reported-by: Coverity CID 312955 Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-11-19fs: btrfs: inode: handle uninitialized type before returning itQu Wenruo
In btrfs_lookup_path() the local variable @type should always be updated after we hit any file/dir. But if @filename is NULL from the very beginning, then we don't initialize it and return it directly. To prevent such problem from happening, we initialize @type to BTRFS_FT_UNKNOWN. For normal execution route, it will get updated for each filename we resolved. Buf if we didn't find any path, we check if the type is still FT_UNKNOWN and ret == 0. If true we know there is something wrong, just return -EUCLEAN to inform the caller. Reported-by: Coverity CID 312958 Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek Behún <marek.behun@nic.cz>
2020-11-19fs/squashfs: Fix index off by 1 for inode SQFS_LDIR_TYPEGerard Koskamp
I've created a squashfs file system with Yocto (it use squashfs-tools) and u-boot command sqfsls give the error:'Error while searching inode: unknown type.' After some digging in the code I found that the index is off by 1. This patch fix this issue and I can successful use the sqfsls command. After search for the squashfs format I found a link talk about a similar issue but this time in the documentation. The link is: https://github.com/AgentD/squashfs-tools-ng/commit/e6588526838caece9529 Signed-off-by: Gerard Koskamp <gerard.koskamp@nedap.com> Tested-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
2020-11-19drivers: led: bcm6858: set the correct led polarity registerSteven Lawrance
This change sets the output (hardware) polarity register instead of the input (software) polarity register for the bcm6858 LED controller. The logic was inverted (a LED configued active high behaved as active low). Signed-off-by: Steven Lawrance <steven.lawrance@softathome.com> Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
2020-11-19km/ppc: use Kconfig for MEMTEST configurationHolger Brunck
Also change back SYS_MEMTEST_END to 0x00f00000. 0xe00000 was wrong and introduced due to the global Kconfig migration of this option in u-boot. CC: Heiko Schocher <hs@denx.de> CC: Tom Rini <trini@konsulko.com> Signed-off-by: Holger Brunck <holger.brunck@hitachi-powergrids.com>
2020-11-19km: replace hardcoded address for imported environmentMatteo Ghidoni
Instead of using an hard coded address, make use of an already defined address for importing the environment for ramfs and nfs boot. This allows boards having different mapping to use the same code. CC: Heiko Schocher <hs@denx.de> CC: Tom Rini <trini@konsulko.com> Signed-off-by: Matteo Ghidoni <matteo.ghidoni@hitachi-powergrids.com> Signed-off-by: Holger Brunck <holger.brunck@hitachi-powergrids.com>
2020-11-19env: typo enougthHeinrich Schuchardt
%s/enougth/enough/ Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2020-11-19tools: dumpimage: Remove remaining mentions of the -i optionTyler Hicks
The -i option of the dumpimage tool has been removed so it should no longer be documented in the README file. Refer readers to the tool's help output rather than maintain a copy of the usage in the README. Finally, adjust the example dumpfile invocation in imagetool.h to use the -o option instead of the removed -i option. Fixes: 12b831879a76 ("tools: dumpimage: Simplify arguments") Signed-off-by: Tyler Hicks <tyhicks@linux.microsoft.com> Cc: Martyn Welch <martyn.welch@collabora.com> Acked-by: Martyn Welch <martyn.welch@collabora.com>
2020-11-19common: fit: add missing newlineMichael Walle
The debug statement doesn't end with a newline. Add it. Signed-off-by: Michael Walle <michael@walle.cc>
2020-11-19tools: image-host.c: use correct variable for strerrnoPhilippe Reynes
In the function get_random_data, strerrno is called with the variable ret (which is the return of the function clock_gettime). It should be called with errnor. This commit fixes this mistake. Reported-by: Coverity (CID: 312956) Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-19tools: image-host.c: use random instead of randPhilippe Reynes
According to the manpage of rand, it is recommended to use random instead of rand. This commit updates the function get_random_data to use random. Reported-by: Coverity (CID: 312953) Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-11-19arm: vexpress: don't reset flags in board_init to avoid losing previous onesArnaud Aujon Chevallier
Re-submitted because of missing description and signed-off. flags reset in board_init caused bugs when executing command like editenv because the reallocated flag was lost. Tested-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Arnaud Aujon Chevallier <arnaud@intelibre.fr>
2020-11-18env: mmc: Correct partition comparison in mmc_offset_try_partitionHoyeonjiki Kim
The function mmc_offset_try_partition searches the MMC partition for locating environment data, by comparing the partition names with config "u-boot,mmc-env-parition". However, it only compares the first word-size bytes (size of 'const char *'), which may make the function to find unintended partition. Correct the function not to partially compare the partition name with config "u-boot,mmc-env-partition". Fixes: c9e87ba66540 ("env: Save environment at the end of an MMC partition") Signed-off-by: Hoyeonjiki Kim <jigi.kim@gmail.com> Reviewed-by: Wolfgang Denk <wd@denx.de>
2020-11-17Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscvTom Rini
- Enable SATA disk on QEMU RISC-V and update doc. - k210 pinctrl updates: - Fix inverted IE and OE for I2C. - Rename power domains to match datasheet.
2020-11-17pinctrl: k210: Rename power domains to match datasheetSean Anderson
This renames power domains to match the names on the k210 datasheet. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com> Reviewed-by: Rick Chen <rick@andestech.com>
2020-11-17pinctrl: k210: Fix inverted IE and OE for I2CSean Anderson
I2C and SCCB previously shared defaults. However, SCCB needs OE_INV and IE_INV set, but I2C cannot have those bits set. This adds a separate default for SCCB. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reported-by: Damien Le Moal <Damien.LeMoal@wdc.com>
2020-11-17doc: qemu-riscv: describe attaching a disk imageHeinrich Schuchardt
How to add an emulated disk to QEMU may not be known to the user. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bin.meng@windriver.com>
2020-11-17riscv: enable SATA disk on QEMU RISC-VHeinrich Schuchardt
Allow attaching a virtual SATA disk to QEMU RISC-V by implying AHCI, AHCI_PCI, CMD_SCSI, DM_SCSI, PCI_INIT_R, SCSI, SCSI_AHCI. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bin.meng@windriver.com>
2020-11-17riscv: sort SPECIFIC_OPTIONSHeinrich Schuchardt
Sort implied options in BOARD_SPECIFIC_OPTIONS in the same sequence as in .config. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bin.meng@windriver.com>
2020-11-16Merge branch 'pr-2020-11-17' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-sunxi - PinePhone support (Samuel) - V3/S3 support (Icenowy)
2020-11-17sunxi: dts: sync Allwinner V3s-related DTs from Linux 5.10-rc1Icenowy Zheng
This commit imports device tree files that are related to Allwinner V3 series from Linux commit 3650b228f83a ("Linux 5.10-rc1"). Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-11-17sunxi: allow to use AXP20[39] attached to I2C0 on V3 seriesIcenowy Zheng
The reference design of Allwinner V3 series uses an AXP203 or AXP209 PMIC attached to the I2C0 bus of the SoC, although the first community-available V3s board, Lichee Pi Zero, omitted it. Allow to introduce support for the PMIC on boards with it. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-11-17clk: sunxi: add compatible string for V3Icenowy Zheng
A new compatible string is introduced for V3 CCU, because it has a few extra features available. Add the compatible string to the clock driver. As the extra features are not touched, just share the description struct now. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-11-17sunxi: gpio: introduce compatible string for V3 GPIOIcenowy Zheng
A new compatible string is introduced for V3 GPIO, because it has more pins available than V3s. Add the compatible string to the GPIO driver. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-11-17sunxi: add V3/S3 supportIcenowy Zheng
Allwinner V3/Sochip S3 uses the same die with Allwinner V3s/S3L, but V3 comes with no co-packaged DDR (DDR3 is usually used externally), and S3L comes with co-packaged DDR3. Add support for Allwinner V3/S3 chips by add SoC names to original V3s choice, and allow to select DDR3. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-11-17sunxi: a64: Add a defconfig for the PinePhoneSamuel Holland
The PinePhone is a smartphone produced by Pine64, with an A64 SoC, 2 or 3 GiB LPDDR3 RAM, 16 or 32 GiB eMMC, 720x1440 MIPI-DSI panel, and Quectel EG25-G modem. There are two main board revisions: 1.1 for early adopters, and 1.2 for mass production. Since there is code to detect the board revision at boot, one config/image can support both boards. Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-11-17sunxi: DT: A64: update device tree filesSamuel Holland
Import updated device trees from Linux tag v5.9. This picks up new hardware (PinePhone, PineTab); and it drops the U-Boot specific DTSI files for the Pinebook and the Teres-I, since the ANX6345 bridge is now supported upstream. A couple of headers needed updates for recently-added hardware support. Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-11-17sunxi: board: Set fdtfile to match the DT chosen by SPLSamuel Holland
Previously, fdtfile was always the value in CONFIG_DEFAULT_DEVICE_TREE. This meant that, regardless of the DT chosen by SPL (either by changing the header in the image or by the selection code at runtime), Linux always used the default DT. By using the name from the SPL header (which, because of the previous commit, always matches the DT used by U-Boot proper), Linux also sees the same board as U-Boot/SPL, even if the boot script later loads a DT from disk. Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> [Andre: remove no longer needed CONFIG_SPL_LOAD_FIT guards] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-11-17sunxi: board: Save the chosen DT name in the SPL headerSamuel Holland
This overwrites the name loaded from the SPL image. It will be different if there was previously no name provided, or if a more accurate name was determined by the board variant selection logic. This means that the DT name in the SPL header now always matches the DT appended to U-Boot. Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> [Andre: move function under CONFIG_SPL_LOAD_FIT guard] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-11-17sunxi: board: Add PinePhone DT selection logicSamuel Holland
There are two different publicly-released revisions of the PinePhone hardware, versions 1.1 and 1.2; and they need different device trees. Since some GPIO pins were rerouted, we can use that to distinguish between them. Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-11-17sunxi: board: Simplify Pine A64 DT selection logicSamuel Holland
Instead of using an entirely separate matching algorithm, simply update the name of the DT we want to match. Enabling this logic does not depend on the FIT config name, only on the initial guess of the board name. Importantly, the initial guess must be "sun50i-a64-pine64-plus", because otherwise the logic would trigger when "sun50i-a64-pine64-lts" was written to the SPL header. Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-11-17sunxi: board: Add a helper to get the SPL DT nameSamuel Holland
This moves the validity checking and typecasts all to one place away from the string comparison logic, and it detangles the compile-time and runtime control flow. The new helper will also be used by U-Boot proper in a future commit. Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> [Andre: protect new function with CONFIG_SPL_LOAD_FIT] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-11-17sunxi: board: Use a more descriptive variable nameSamuel Holland
The variable "cmp_str" always leaves me wondering if it is the DT name of the current board (yes) or DT name in the FIT config entry (no). In preparation for expanding the functionality here, rename it to something that obviously means "this is the DT name we are looking for". Acked-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2020-11-16Merge tag 'ti-v2021.01-rc3' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-ti - Fix Nokia RX-51 boot issues - Fix CONFIG_LOGLEVEL on K3 devices - Add phyBOARD REGOR support