summaryrefslogtreecommitdiff
path: root/crypto/algif_skcipher.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2017-09-07 10:17:02 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2017-09-07 10:17:02 +0200
commita8935c98cf97201e9ee50f22a27264a3220c82e8 (patch)
tree74b97b59080411d7d49a057d908a8278f71ea709 /crypto/algif_skcipher.c
parent1bab88a22447c96f832aca1115370cfdd75fb168 (diff)
parent573b59e17e37fc19577630391c08f7b1e26609d8 (diff)
Merge 4.4.87 into android-4.4
Changes in 4.4.87 irqchip: mips-gic: SYNC after enabling GIC region i2c: ismt: Don't duplicate the receive length for block reads i2c: ismt: Return EMSGSIZE for block reads with bogus length ceph: fix readpage from fscache cpumask: fix spurious cpumask_of_node() on non-NUMA multi-node configs cpuset: Fix incorrect memory_pressure control file mapping alpha: uapi: Add support for __SANE_USERSPACE_TYPES__ CIFS: Fix maximum SMB2 header size CIFS: remove endian related sparse warning wl1251: add a missing spin_lock_init() xfrm: policy: check policy direction value drm/ttm: Fix accounting error when fail to get pages for pool kvm: arm/arm64: Fix race in resetting stage2 PGD kvm: arm/arm64: Force reading uncached stage2 PGD epoll: fix race between ep_poll_callback(POLLFREE) and ep_free()/ep_remove() crypto: algif_skcipher - only call put_page on referenced and used pages Linux 4.4.87 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'crypto/algif_skcipher.c')
-rw-r--r--crypto/algif_skcipher.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index f5e9f9310b48..b3b0004ea8ac 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -86,8 +86,13 @@ static void skcipher_free_async_sgls(struct skcipher_async_req *sreq)
}
sgl = sreq->tsg;
n = sg_nents(sgl);
- for_each_sg(sgl, sg, n, i)
- put_page(sg_page(sg));
+ for_each_sg(sgl, sg, n, i) {
+ struct page *page = sg_page(sg);
+
+ /* some SGs may not have a page mapped */
+ if (page && atomic_read(&page->_count))
+ put_page(page);
+ }
kfree(sreq->tsg);
}