diff --git a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c index 220a484..558bc07 100644 --- a/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c +++ b/arch/arm/boards/eukrea_cpuimx35/eukrea_cpuimx35.c @@ -242,7 +242,7 @@ reg = writel(reg, MX35_CCM_BASE_ADDR + MX35_CCM_CGR0); reg = readl(MX35_CCM_BASE_ADDR + MX35_CCM_CGR1); reg |= 0x3 << MX35_CCM_CGR1_FEC_SHIFT; - reg |= 0x3 << MX35_CCM_CGR1_I2C1_SHIFT, + reg |= 0x3 << MX35_CCM_CGR1_I2C1_SHIFT; reg = writel(reg, MX35_CCM_BASE_ADDR + MX35_CCM_CGR1); reg = readl(MX35_CCM_BASE_ADDR + MX35_CCM_CGR2); reg |= 0x3 << MX35_CCM_CGR2_USB_SHIFT; diff --git a/arch/arm/dts/imx6q-phytec-phycard.dts b/arch/arm/dts/imx6q-phytec-phycard.dts index c06461c..b0e47e9 100644 --- a/arch/arm/dts/imx6q-phytec-phycard.dts +++ b/arch/arm/dts/imx6q-phytec-phycard.dts @@ -16,7 +16,7 @@ / { model = "PHYTEC phyCARD-i.MX6 Quad"; - compatible = "phytec,imx6q-pbaa03", "phytec,imx6q-pcaaxl3", "fsl,imx6q"; + compatible = "phytec,imx6q-pcaaxl3", "fsl,imx6q"; chosen { stdout-path = &uart3; diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h index 9c21066..22b9642 100644 --- a/arch/arm/include/asm/types.h +++ b/arch/arm/include/asm/types.h @@ -1,52 +1,6 @@ #ifndef __ASM_ARM_TYPES_H #define __ASM_ARM_TYPES_H -#ifndef __ASSEMBLY__ - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -#endif /* __ASSEMBLY__ */ - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -#include - -#ifndef __ASSEMBLY__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ +#include #endif diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c index 207e187..2f9ffbd 100644 --- a/arch/arm/mach-imx/iim.c +++ b/arch/arm/mach-imx/iim.c @@ -329,10 +329,10 @@ iim->bank[num] = bank; - bank->map_config.reg_bits = 8, - bank->map_config.val_bits = 8, - bank->map_config.reg_stride = 1, - bank->map_config.max_register = (nregs - 1), + bank->map_config.reg_bits = 8; + bank->map_config.val_bits = 8; + bank->map_config.reg_stride = 1; + bank->map_config.max_register = (nregs - 1); bank->map_config.name = xasprintf("bank%d", num); bank->map = regmap_init(&iim->dev, &imx_iim_regmap_bus, bank, &bank->map_config); diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index c155199..4df9853 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -39,7 +39,11 @@ */ static inline void *phys_to_virt(unsigned long address) { - return (void *)CKSEG0ADDR(address); + if (IS_ENABLED(CONFIG_MMU)) { + return (void *)CKSEG0ADDR(address); + } + + return (void *)CKSEG1ADDR(address); } #define IO_SPACE_LIMIT 0 diff --git a/arch/mips/lib/reloc.c b/arch/mips/lib/reloc.c index 4b0e252..b084a88 100644 --- a/arch/mips/lib/reloc.c +++ b/arch/mips/lib/reloc.c @@ -120,7 +120,11 @@ length = __bss_stop - __image_start; relocaddr = ALIGN_DOWN(ram_size - length, SZ_64K); - relocaddr = KSEG0ADDR(relocaddr); + if (IS_ENABLED(CONFIG_MMU)) { + relocaddr = KSEG0ADDR(relocaddr); + } else { + relocaddr = KSEG1ADDR(relocaddr); + } new_stack = relocaddr - MALLOC_SIZE - 16; /* diff --git a/arch/nios2/include/asm/int-ll64.h b/arch/nios2/include/asm/int-ll64.h deleted file mode 100644 index f394147..0000000 --- a/arch/nios2/include/asm/int-ll64.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * asm-generic/int-ll64.h - * - * Integer declarations for architectures which use "long long" - * for 64-bit types. - */ - -#ifndef _ASM_GENERIC_INT_LL64_H -#define _ASM_GENERIC_INT_LL64_H - -#include - -#ifndef __ASSEMBLY__ -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#ifdef __GNUC__ -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#else -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -#endif /* __ASSEMBLY__ */ - -#ifdef __KERNEL__ - -#ifndef __ASSEMBLY__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#define S8_C(x) x -#define U8_C(x) x ## U -#define S16_C(x) x -#define U16_C(x) x ## U -#define S32_C(x) x -#define U32_C(x) x ## U -#define S64_C(x) x ## LL -#define U64_C(x) x ## ULL - -#else /* __ASSEMBLY__ */ - -#define S8_C(x) x -#define U8_C(x) x -#define S16_C(x) x -#define U16_C(x) x -#define S32_C(x) x -#define U32_C(x) x -#define S64_C(x) x -#define U64_C(x) x - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif /* _ASM_GENERIC_INT_LL64_H */ diff --git a/arch/nios2/include/asm/types.h b/arch/nios2/include/asm/types.h index 0067ea8..380ad34 100644 --- a/arch/nios2/include/asm/types.h +++ b/arch/nios2/include/asm/types.h @@ -1,6 +1,6 @@ #ifndef __ASM_TYPES_H #define __ASM_TYPES_H -#include +#include #endif diff --git a/arch/nios2/lib/libgcc.c b/arch/nios2/lib/libgcc.c index abf93fd..814df73 100644 --- a/arch/nios2/lib/libgcc.c +++ b/arch/nios2/lib/libgcc.c @@ -319,15 +319,15 @@ DWunion vv = {.ll = v}; DWtype w; - if (uu.s.high < 0) - c = ~c, + if (uu.s.high < 0) { + c = ~c; + uu.ll = -uu.ll; + } - uu.ll = -uu.ll; - - if (vv.s.high < 0) - c = ~c, - - vv.ll = -vv.ll; + if (vv.s.high < 0) { + c = ~c; + vv.ll = -vv.ll; + } w = __udivmoddi4(uu.ll, vv.ll, (UDWtype *) 0); @@ -366,9 +366,10 @@ DWunion vv = {.ll = v}; DWtype w; - if (uu.s.high < 0) - c = ~c, + if (uu.s.high < 0) { + c = ~c; uu.ll = -uu.ll; + } if (vv.s.high < 0) vv.ll = -vv.ll; diff --git a/arch/openrisc/include/asm/types.h b/arch/openrisc/include/asm/types.h index 8ee6bb0..21a45b7 100644 --- a/arch/openrisc/include/asm/types.h +++ b/arch/openrisc/include/asm/types.h @@ -16,52 +16,6 @@ #ifndef _ASM_TYPES_H #define _ASM_TYPES_H -/* - * This file is never included by application software unless - * explicitly requested (e.g., via linux/types.h) in which case the - * application is Linux specific so (user-) name space pollution is - * not a major issue. However, for interoperability, libraries still - * need to be careful to avoid a name clashes. - */ - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ +#include #endif /* _ASM_TYPES_H */ diff --git a/arch/powerpc/include/asm/types.h b/arch/powerpc/include/asm/types.h index 2d3ce0a..f3d4190 100644 --- a/arch/powerpc/include/asm/types.h +++ b/arch/powerpc/include/asm/types.h @@ -1,45 +1,14 @@ #ifndef _PPC_TYPES_H #define _PPC_TYPES_H +#include + #ifndef __ASSEMBLY__ -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - typedef struct { __u32 u[4]; } __attribute((aligned(16))) vector128; -#ifdef __KERNEL__ -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ #endif diff --git a/arch/riscv/include/asm/types.h b/arch/riscv/include/asm/types.h index 8200a03..af37d77 100644 --- a/arch/riscv/include/asm/types.h +++ b/arch/riscv/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_RISCV_TYPES_H #define __ASM_RISCV_TYPES_H +#include + #ifdef __riscv64 /* * This is used in dlmalloc. On RISCV64 we need it to be 64 bit @@ -15,44 +17,4 @@ #endif -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ - #endif /* __ASM_RISCV_TYPES_H */ diff --git a/arch/sandbox/include/asm/types.h b/arch/sandbox/include/asm/types.h index 8426de4..3e4a8f7 100644 --- a/arch/sandbox/include/asm/types.h +++ b/arch/sandbox/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_I386_TYPES_H #define __ASM_I386_TYPES_H +#include + #ifdef __x86_64__ /* * This is used in dlmalloc. On X86_64 we need it to be @@ -16,44 +18,4 @@ #endif -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ - #endif diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index e57ae2c..17947b2 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -1,6 +1,8 @@ #ifndef __ASM_I386_TYPES_H #define __ASM_I386_TYPES_H +#include + #ifndef __ASSEMBLY__ #ifdef __x86_64__ @@ -18,46 +20,6 @@ #endif -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -typedef __signed__ long long __s64; -typedef unsigned long long __u64; -#endif - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -#include - -#endif /* __KERNEL__ */ - #endif #endif diff --git a/common/blspec.c b/common/blspec.c index 1a6d581..9e1036c 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -298,6 +298,18 @@ val = end; + if (!strcmp(name, "options")) { + /* If there was a previous "options" key given, prepend its value + * (as per spec). */ + const char *prev_val = blspec_entry_var_get(entry, name); + if (prev_val) { + char *opts = xasprintf("%s %s", prev_val, val); + blspec_entry_var_set(entry, name, opts); + free(opts); + continue; + } + } + blspec_entry_var_set(entry, name, val); } diff --git a/common/password.c b/common/password.c index a2a9c4c..3c08ab7 100644 --- a/common/password.c +++ b/common/password.c @@ -161,6 +161,9 @@ unsigned char *buf = (unsigned char *)default_passwd; unsigned char c; + if (ARRAY_SIZE(default_passwd) == 1) + return -ENOSYS; + if (!sum || length < 1) return -EINVAL; @@ -179,7 +182,6 @@ return 0; } -EXPORT_SYMBOL(read_default_passwd); static int read_env_passwd(unsigned char *sum, size_t length) { diff --git a/drivers/i2c/busses/i2c-imx-early.c b/drivers/i2c/busses/i2c-imx-early.c index 26922c1..472e4be 100644 --- a/drivers/i2c/busses/i2c-imx-early.c +++ b/drivers/i2c/busses/i2c-imx-early.c @@ -282,7 +282,7 @@ i2c_fsl_stop(fsl_i2c); /* Disable I2C controller, and force our state to stopped */ - temp = fsl_i2c->i2cr_ien_opcode ^ I2CR_IEN, + temp = fsl_i2c->i2cr_ien_opcode ^ I2CR_IEN; fsl_i2c_write_reg(temp, fsl_i2c, FSL_I2C_I2CR); return (ret < 0) ? ret : num; diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 6911f80..7d25ed3 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -511,7 +511,7 @@ i2c_fsl_stop(adapter); /* Disable I2C controller, and force our state to stopped */ - temp = i2c_fsl->hwdata->i2cr_ien_opcode ^ I2CR_IEN, + temp = i2c_fsl->hwdata->i2cr_ien_opcode ^ I2CR_IEN; fsl_i2c_write_reg(temp, i2c_fsl, FSL_I2C_I2CR); return (result < 0) ? result : num; diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index bdb34ca..d3f525f 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1176,7 +1176,7 @@ omap_i2c_idle(i2c_omap); - i2c_omap->adapter.master_xfer = omap_i2c_xfer, + i2c_omap->adapter.master_xfer = omap_i2c_xfer; i2c_omap->adapter.nr = pdev->id; i2c_omap->adapter.dev.parent = pdev; i2c_omap->adapter.dev.device_node = pdev->device_node; diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c index 3ce3bb0..da2dc59 100644 --- a/drivers/mci/stm32_sdmmc2.c +++ b/drivers/mci/stm32_sdmmc2.c @@ -586,8 +586,8 @@ priv->dev = dev; mci = &priv->mci; - mci->send_cmd = stm32_sdmmc2_send_cmd, - mci->set_ios = stm32_sdmmc2_set_ios, + mci->send_cmd = stm32_sdmmc2_send_cmd; + mci->set_ios = stm32_sdmmc2_set_ios; mci->init = stm32_sdmmc2_reset; mci->hw_dev = dev; diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 406b8c9..7397034 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -198,11 +198,11 @@ edev = &undev->edev; undev->udev = usbdev; - edev->open = usbnet_open, - edev->init = usbnet_init, - edev->send = usbnet_send, - edev->recv = usbnet_recv, - edev->halt = usbnet_halt, + edev->open = usbnet_open; + edev->init = usbnet_init; + edev->send = usbnet_send; + edev->recv = usbnet_recv; + edev->halt = usbnet_halt; edev->priv = undev; edev->parent = &usbdev->dev; diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 0751c52..865ecdd 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c @@ -204,6 +204,7 @@ cdev->putc = pl011_putc; cdev->getc = pl011_getc; cdev->setbrg = pl011_setbaudrate; + cdev->linux_console_name = "ttyAMA"; pl011_init_port(cdev); diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index 5d6cec8..f117ab9 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -308,6 +308,17 @@ return ((ns16550_read(cdev, lsr) & LSR_DR) != 0); } +/** + * @brief Flush remaining characters in serial device + * + * @param[in] cdev pointer to console device + */ +static void ns16550_flush(struct console_device *cdev) +{ + /* Loop Doing Nothing */ + while ((ns16550_read(cdev, lsr) & LSR_TEMT) == 0) ; +} + static void ns16550_probe_dt(struct device_d *dev, struct ns16550_priv *priv) { struct device_node *np = dev->device_node; @@ -501,6 +512,7 @@ cdev->putc = ns16550_putc; cdev->getc = ns16550_getc; cdev->setbrg = ns16550_setbaudrate; + cdev->flush = ns16550_flush; cdev->linux_console_name = devtype->linux_console_name; priv->fcrval = FCRVAL; diff --git a/drivers/serial/stm-serial.c b/drivers/serial/stm-serial.c index ea48241..a2c3dcf 100644 --- a/drivers/serial/stm-serial.c +++ b/drivers/serial/stm-serial.c @@ -159,6 +159,7 @@ cdev->flush = stm_serial_flush; cdev->setbrg = stm_serial_setbaudrate; cdev->dev = dev; + cdev->linux_console_name = "ttyAMA"; dev->priv = priv; iores = dev_request_mem_resource(dev, 0); diff --git a/include/.gitignore b/include/.gitignore index f28372a..18e58a7 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -1,2 +1 @@ -asm /config.h diff --git a/lib/logo/Makefile b/lib/logo/Makefile index eb7aee0..bf700da 100644 --- a/lib/logo/Makefile +++ b/lib/logo/Makefile @@ -1,17 +1,17 @@ -OPTS_barebox-logo-w64.bblogo="-w 64" +OPTS_barebox-logo-w64.bblogo = --export-width=64 bblogo-$(CONFIG_BAREBOX_LOGO_64) += barebox-logo-w64 -OPTS_barebox-logo-w240.bblogo="-w 240" +OPTS_barebox-logo-w240.bblogo = --export-width=240 bblogo-$(CONFIG_BAREBOX_LOGO_240) += barebox-logo-w240 -OPTS_barebox-logo-w320.bblogo="-w 320" +OPTS_barebox-logo-w320.bblogo = --export-width=320 bblogo-$(CONFIG_BAREBOX_LOGO_320) += barebox-logo-w320 -OPTS_barebox-logo-w400.bblogo="-w 400" +OPTS_barebox-logo-w400.bblogo = --export-width=400 bblogo-$(CONFIG_BAREBOX_LOGO_400) += barebox-logo-w400 -OPTS_barebox-logo-w640.bblogo="-w 640" +OPTS_barebox-logo-w640.bblogo = --export-width=640 bblogo-$(CONFIG_BAREBOX_LOGO_640) += barebox-logo-w640 obj-y += $(patsubst %,%.bblogo.o,$(bblogo-y)) @@ -38,10 +38,17 @@ %.bblogo.S: %.bblogo FORCE $(call if_changed,logo_S) +# Inkscape 0.92.4 supports -z but Inkscape 1.0 doesn't +INKSCAPEOPTS += $(call try-run, inkscape -z,-z,) +# Inkscape 0.92.4 uses -e but Inkscape 1.0 uses --export-type=png +INKSCAPEOPTS += $(call try-run, inkscape -e -,-e -,--export-type=png) +# Inkscape 1.0 supports -o - +INKSCAPEOPTS += $(call try-run, inkscape -o -,-o -,) + quiet_cmd_logo = LOGO.S $@ cmd_logo = \ ( \ - inkscape -z $(OPTS_$(@F)) -e $@ $< > /dev/null; \ + DISPLAY="" inkscape $(OPTS_$(@F)) $(INKSCAPEOPTS) $< > $@; \ ) %.bblogo: $(srctree)/Documentation/barebox.svg FORCE diff --git a/net/nfs.c b/net/nfs.c index 6357309..591417e 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -533,7 +533,7 @@ static int nfs_read_reply(unsigned char *pkt, unsigned len) { - int rlen; + unsigned int rlen; uint32_t *data; int ret; @@ -552,6 +552,8 @@ rlen = ntohl(net_read_uint32(data + 18)); + rlen = max_t(unsigned int, rlen, len - 19); + ret = write(net_store_fd, (char *)(data + 19), rlen); if (ret < 0) { perror("write"); diff --git a/scripts/.gitignore b/scripts/.gitignore index c3ac0b5..7c9a3f5 100644 --- a/scripts/.gitignore +++ b/scripts/.gitignore @@ -31,3 +31,4 @@ mips-relocs rsatoc stm32image +mvebuimg