net/can/can_recvmsg.c: fix warning

This commit is contained in:
raiden00pl 2021-12-30 09:53:38 +01:00 committed by Gustavo Henrique Nihei
parent c7d3a674fd
commit 649619b8f8
1 changed files with 3 additions and 0 deletions

View File

@ -410,7 +410,10 @@ static uint16_t can_recvfrom_eventhandler(FAR struct net_driver_s *dev,
FAR void *pvpriv, uint16_t flags)
{
struct can_recvfrom_s *pstate = (struct can_recvfrom_s *)pvpriv;
#if defined(CONFIG_NET_CANPROTO_OPTIONS) || defined(CONFIG_NET_CAN_CANFD) || \
defined(CONFIG_NET_TIMESTAMP)
struct can_conn_s *conn = (struct can_conn_s *)pstate->pr_sock->s_conn;
#endif
/* 'priv' might be null in some race conditions (?) */