diff options
author | Jérôme Glisse <jglisse@redhat.com> | 2019-01-25 11:16:54 -0500 |
---|---|---|
committer | Jérôme Glisse <jglisse@redhat.com> | 2019-01-29 10:34:59 -0500 |
commit | 78e4894f13d8a337e3794223aa69ebe9c346f794 (patch) | |
tree | 2fcd01d65ae2a6abb1839c3b6396c1e94908f21c /crypto/vmac.c | |
parent | f5ac6bab37cb584c8ec4c0b96f5f6586946c8b15 (diff) |
mm/hmm: add helpers for driver to safely take the mmap_semhmm-for-5.1
The device driver context which holds reference to mirror and thus to
core hmm struct might outlive the mm against which it was created. To
avoid every driver to check for that case provide an helper that check
if mm is still alive and take the mmap_sem in read mode if so. If the
mm have been destroy (mmu_notifier release call back did happen) then
we return -EINVAL so that calling code knows that it is trying to do
something against a mm that is no longer valid.
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Diffstat (limited to 'crypto/vmac.c')
0 files changed, 0 insertions, 0 deletions