]> git.baikalelectronics.ru Git - 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)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 11 Sep 2022 23:22:31 +0000 (16:22 -0700)
commitb83802303d7f3b11e550ce7893b802f25bdea21d
tree8c2e0c17aba9d747a01b4e8777aa9850e60eb8a6
parent981261cb635d8ea0090ce42d3fd01789721b757f
mm: fix dereferencing possible ERR_PTR

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: f5c799ee1c0f5 ("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>
mm/secretmem.c