]> git.baikalelectronics.ru Git - uboot.git/commit
fs: fat: avoid NULL dereference when root dir is full
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 19 Nov 2020 11:24:44 +0000 (12:24 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 29 Nov 2020 04:18:16 +0000 (05:18 +0100)
commit9faa2ce80bcc8cf4f863c01ec64bc90bef78372c
tree8b94207b8dacbc7370398492f30e2d9133ef420d
parentc4df504a85d84a917a8885eed752d61243f4b5ba
fs: fat: avoid NULL dereference when root dir is full

When trying to create a file in the full root directory of a FAT32
filesystem a NULL dereference can be observed.

When the root directory of a FAT16 filesystem is full fill_dir_slot() must
return -1 to signal that a new directory entry could not be allocated.

Fixes: f9d0578fbe11 ("fs: fat: allocate a new cluster for root directory of fat32")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
fs/fat/fat_write.c