]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
mm: fix dereferencing possible ERR_PTR
authorBinyi Han <dantengknight@gmail.com>
Sun, 4 Sep 2022 07:46:47 +0000 (00:46 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 14 Nov 2022 10:25:27 +0000 (11:25 +0100)
commitd5bd4dc657758e9dc3447415ae7c05d97d9c24fe
tree63fd49e9111dd0cb26beb714e13462e433e3ac85
parent3c82f7842da49885ba8f6a5169bbff3a7aca0b25
mm: fix dereferencing possible ERR_PTR

BugLink: https://bugs.launchpad.net/bugs/1995517
commit 4eb5bbde3ccb710d3b85bfb13466612e56393369 upstream.

Smatch checker complains that 'secretmem_mnt' dereferencing possible
ERR_PTR().  Let the function return if 'secretmem_mnt' is ERR_PTR, to
avoid deferencing it.

Link: https://lkml.kernel.org/r/20220904074647.GA64291@cloud-MacBookPro
Fixes: 1507f51255c9f ("mm: introduce memfd_secret system call to create "secret" memory areas")
Signed-off-by: Binyi Han <dantengknight@gmail.com>
Reviewed-by: Andrew Morton <akpm@linux-foudation.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
mm/secretmem.c