mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 03:05:40 +08:00
mm/iob: iob members are initialized after allocate
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -183,10 +183,6 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch)
|
||||
|
||||
void lib_syslogstream_open(FAR struct lib_syslogstream_s *stream)
|
||||
{
|
||||
#ifdef CONFIG_SYSLOG_BUFFER
|
||||
FAR struct iob_s *iob;
|
||||
#endif
|
||||
|
||||
DEBUGASSERT(stream != NULL);
|
||||
|
||||
/* Initialize the common fields */
|
||||
@@ -198,17 +194,7 @@ void lib_syslogstream_open(FAR struct lib_syslogstream_s *stream)
|
||||
#ifdef CONFIG_SYSLOG_BUFFER
|
||||
/* Allocate an IOB */
|
||||
|
||||
iob = iob_tryalloc(true);
|
||||
stream->iob = iob;
|
||||
|
||||
if (iob != NULL)
|
||||
{
|
||||
/* Initialize the IOB */
|
||||
|
||||
iob->io_len = 0;
|
||||
iob->io_offset = 0;
|
||||
iob->io_pktlen = 0;
|
||||
}
|
||||
stream->iob = iob_tryalloc(true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user