[net][sal] fix delay_work timer not detach problem

Signed-off-by: chenyong <1521761801@qq.com>
This commit is contained in:
chenyong 2019-04-17 18:42:10 +08:00
parent a6900a2d6f
commit 9df6313537
1 changed files with 3 additions and 1 deletions

View File

@ -146,6 +146,7 @@ static void check_netdev_internet_up_work(struct rt_work *work, void *work_data)
struct netdev *netdev = (struct netdev *)work_data;
socklen_t addr_len = sizeof(struct sockaddr_in);
char send_data[SAL_INTERNET_BUFF_LEN], recv_data = 0;
struct rt_delayed_work *delay_work = (struct rt_delayed_work *)work;
const char month[][SAL_INTERNET_MONTH_LEN] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
char date[SAL_INTERNET_DATE_LEN];
@ -156,7 +157,8 @@ static void check_netdev_internet_up_work(struct rt_work *work, void *work_data)
if (work)
{
rt_free((struct rt_delayed_work *)work);
rt_timer_detach(&(delay_work->timer));
rt_free(delay_work);
}
/* get network interface socket operations */