mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
drivers/usbdev/cdcacm.c: fix runtime error memcpy para is null
usbdev/cdcacm.c:2974:3: runtime error: null pointer passed as argument 2, which is declared to never be null
#0 0x44716307 in cdcuart_dmasend usbdev/cdcacm.c:2974
Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit is contained in:
@@ -2982,8 +2982,12 @@ static void cdcuart_dmasend(FAR struct uart_dev_s *dev)
|
||||
req->len = nbytes;
|
||||
|
||||
nbytes = MIN(reqlen - nbytes, xfer->nlength);
|
||||
memcpy(req->buf + req->len, xfer->nbuffer, nbytes);
|
||||
req->len += nbytes;
|
||||
if (nbytes)
|
||||
{
|
||||
memcpy(req->buf + req->len, xfer->nbuffer, nbytes);
|
||||
req->len += nbytes;
|
||||
}
|
||||
|
||||
xfer->nbytes = req->len;
|
||||
|
||||
uart_xmitchars_done(dev);
|
||||
|
||||
Reference in New Issue
Block a user