mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-06 07:33:17 +00:00
cpukit/jffs2: Avoid possible null deref
This was added with the writebuffer work and should have been protected by the error check.
This commit is contained in:
committed by
Joel Sherrill
parent
7163014e3f
commit
acf4eb271c
@@ -1365,11 +1365,11 @@ int rtems_jffs2_initialize(
|
|||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (err == 0) {
|
||||||
sb = &fs_info->sb;
|
sb = &fs_info->sb;
|
||||||
c = JFFS2_SB_INFO(sb);
|
c = JFFS2_SB_INFO(sb);
|
||||||
c->mtd = NULL;
|
c->mtd = NULL;
|
||||||
|
|
||||||
if (err == 0) {
|
|
||||||
rtems_recursive_mutex_init(&sb->s_mutex, RTEMS_FILESYSTEM_TYPE_JFFS2);
|
rtems_recursive_mutex_init(&sb->s_mutex, RTEMS_FILESYSTEM_TYPE_JFFS2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user