]> git.karo-electronics.de Git - karo-tx-linux.git/commit
shmem: fix double uncharge in __shmem_file_setup()
authorKonstantin Khlebnikov <koct9i@gmail.com>
Thu, 26 Jun 2014 00:42:42 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:42 +0000 (10:42 +1000)
commit0b6849b6dea6c654280886049a158049cf90f89d
tree0476133ed0834ba0bb830a020a17ca0a9d44b396
parent4834fd7ab2481deb85d455154638408db1ee5b90
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 <koct9i@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/shmem.c