Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70030929 authored by OGAWA Hirofumi's avatar OGAWA Hirofumi
Browse files

fat: Fix possible null deref in fat_cache_add()

parent 384f5c96
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -151,6 +151,13 @@ static void fat_cache_add(struct inode *inode, struct fat_cache_id *new)
			spin_unlock(&MSDOS_I(inode)->cache_lru_lock);

			tmp = fat_cache_alloc(inode);
			if (!tmp) {
				spin_lock(&MSDOS_I(inode)->cache_lru_lock);
				MSDOS_I(inode)->nr_caches--;
				spin_unlock(&MSDOS_I(inode)->cache_lru_lock);
				return;
			}

			spin_lock(&MSDOS_I(inode)->cache_lru_lock);
			cache = fat_cache_merge(inode, new);
			if (cache != NULL) {