From: Konstantin Khlebnikov Date: Wed, 6 Aug 2014 23:06:32 +0000 (-0700) Subject: shmem: fix double uncharge in __shmem_file_setup() X-Git-Tag: cleanup-for-v3.18~96^2~137 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66ee4b8887ec5ce04bae3e840d206db7b7ad34d1;p=pandora-kernel.git shmem: fix double uncharge in __shmem_file_setup() If __shmem_file_setup() fails on struct file allocation it uncharges memory commitment twice: first by shmem_unacct_size() and second time implicitly in shmem_evict_inode() when it kills the newly created inode. This patch removes shmem_unacct_size() from error path if the inode was already there. Signed-off-by: Konstantin Khlebnikov Acked-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed