net/devif: correct the judgment condition in devif_send()

Regression by:

| commit 7fce145b30
| Author: chao an <anchao@xiaomi.com>
| Date:   Mon Jan 30 21:36:39 2023 +0800
|
|     net/devif: check the net device before use
|
|     Signed-off-by: chao an <anchao@xiaomi.com>

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-01-31 20:57:19 +08:00 committed by Xiang Xiao
parent 4f957f8031
commit 30aa0ee700

View File

@ -93,7 +93,7 @@ void devif_send(FAR struct net_driver_s *dev, FAR const void *buf,
/* Append the send buffer after device buffer */
if (len > iob_navail(false) * CONFIG_IOB_BUFSIZE &&
if (len > iob_navail(false) * CONFIG_IOB_BUFSIZE ||
netdev_iob_prepare(dev, false, 0) != OK)
{
ret = -ENOMEM;