Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext2: check err when partial != NULL

Check err when partial == NULL is meaningless because
partial == NULL means getting branch successfully without
error.

CC: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191105045100.7104-1-cgxu519@mykernel.net
Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Chengguang Xu and committed by
Jan Kara
e705f4b8 df4bb5d1

+5 -2
+5 -2
fs/ext2/inode.c
··· 701 701 if (!partial) { 702 702 count++; 703 703 mutex_unlock(&ei->truncate_mutex); 704 - if (err) 705 - goto cleanup; 706 704 goto got_it; 705 + } 706 + 707 + if (err) { 708 + mutex_unlock(&ei->truncate_mutex); 709 + goto cleanup; 707 710 } 708 711 } 709 712