Commit b1485601 authored by Robert Sprowson's avatar Robert Sprowson

More faithful emulation of config_devalloc()

In NetBSD when the softc is allocated they use kmem_zalloc() which zeroes the memory too; follow suit by using calloc instead of malloc.
Fixes problem where an unconfigured network interface (that has never sent any packets, even an ARP) would watchdog after 62s (the consistent random value in if_timer) and try to pass a phantom mbuf to MbufManager, leading to an abort.

Version 0.03. Tagged as 'EtherCPSW-0_03'
parent 4bfac56c
/* (0.02)
/* (0.03)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.02
#define Module_MajorVersion_CMHG 0.03
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 24 Nov 2015
#define Module_Date_CMHG 18 Nov 2016
#define Module_MajorVersion "0.02"
#define Module_Version 2
#define Module_MajorVersion "0.03"
#define Module_Version 3
#define Module_MinorVersion ""
#define Module_Date "24 Nov 2015"
#define Module_Date "18 Nov 2016"
#define Module_ApplicationDate "24-Nov-15"
#define Module_ApplicationDate "18-Nov-16"
#define Module_ComponentName "EtherCPSW"
#define Module_ComponentPath "bsd/RiscOS/Sources/Networking/Ethernet/EtherCPSW"
#define Module_FullVersion "0.02"
#define Module_HelpVersion "0.02 (24 Nov 2015)"
#define Module_LibraryVersionInfo "0:2"
#define Module_FullVersion "0.03"
#define Module_HelpVersion "0.03 (18 Nov 2016)"
#define Module_LibraryVersionInfo "0:3"
......@@ -937,7 +937,7 @@ _kernel_oserror *ethercp_init(const char *cmd_tail, int podule_base, void *pw)
}
/* Now, get attached to the chip */
softc = malloc(cpsw_ca.ca_devsize);
softc = calloc(1, cpsw_ca.ca_devsize);
if (softc == NULL)
{
error = ethercp_error_lookup((ethercp_err_t)ENOMEM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment