From f78cc7d88d26bbbaa77b13551d221580e4360997 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 25 Feb 2014 16:41:11 -0600 Subject: [PATCH] networking: Fix one place where the reference count was not being zeroed. This is really a cosmetic fix UNLESS CONFIG_DEBUG_NET is enabled, then it causes assertions --- ChangeLog | 4 ++++ configs/stm3240g-eval/src/stm3240g-internal.h | 12 ++++++++++++ configs/stm3240g-eval/src/up_autoleds.c | 4 ++-- configs/stm3240g-eval/src/up_boot.c | 2 +- net/net_close.c | 1 + 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e7f9c554c..c5f43204df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6665,3 +6665,7 @@ sys/types.h. stdef.h is the correct location for the definition, but it includes sys/types.h so, at least for now, the definition will be retained in sys/types.h (2014-2-25). + * net/net_close.c: Fix one place where the connection reference count + was not being decremented. This is really a cosmetic change BUT + when CONFIG_DEBUG_NET is enable, it will cause assertions (2014-2-25). + diff --git a/configs/stm3240g-eval/src/stm3240g-internal.h b/configs/stm3240g-eval/src/stm3240g-internal.h index 8db3def21d..3d6e522f0d 100644 --- a/configs/stm3240g-eval/src/stm3240g-internal.h +++ b/configs/stm3240g-eval/src/stm3240g-internal.h @@ -242,6 +242,18 @@ void weak_function stm32_usbinitialize(void); int stm32_usbhost_initialize(void); #endif +/**************************************************************************************************** + * Name: stm32_led_initialize + * + * Description: + * Initialize LEDs + * + ****************************************************************************************************/ + +#ifdef CONFIG_ARCH_LEDS +void stm32_autoled_initialize(void); +#endif + /**************************************************************************************************** * Name: stm32_extmemgpios * diff --git a/configs/stm3240g-eval/src/up_autoleds.c b/configs/stm3240g-eval/src/up_autoleds.c index 5e2cc44dee..09e527cc6b 100644 --- a/configs/stm3240g-eval/src/up_autoleds.c +++ b/configs/stm3240g-eval/src/up_autoleds.c @@ -224,10 +224,10 @@ static void led_setonoff(unsigned int bits) ****************************************************************************/ /**************************************************************************** - * Name: board_led_initialize + * Name: stm32_autoled_initialize ****************************************************************************/ -void board_led_initialize(void) +void stm32_autoled_initialize(void) { /* Configure LED1-4 GPIOs for output */ diff --git a/configs/stm3240g-eval/src/up_boot.c b/configs/stm3240g-eval/src/up_boot.c index cd184a3680..35989f90fe 100644 --- a/configs/stm3240g-eval/src/up_boot.c +++ b/configs/stm3240g-eval/src/up_boot.c @@ -239,7 +239,7 @@ void stm32_boardinitialize(void) /* Configure on-board LEDs if LED support has been selected. */ #ifdef CONFIG_ARCH_LEDS - board_led_initialize(); + stm32_autoled_initialize(); #endif } diff --git a/net/net_close.c b/net/net_close.c index 7bec9237ca..9e3b7c50a8 100644 --- a/net/net_close.c +++ b/net/net_close.c @@ -447,6 +447,7 @@ int psock_close(FAR struct socket *psock) /* Yes... then perform the disconnection now */ uip_unlisten(conn); /* No longer accepting connections */ + conn->crefs = 0; /* Discard our reference to the connection */ err = netclose_disconnect(psock); /* Break any current connections */ if (err < 0) {