dm table: check that a dm device doesn't reference itself

If a DM device's table references itself, it will crash the kernel with an
infinite recursion.  Check for a self-reference in dm_get_device(). This
is a quick check, but it won't catch more complicated circular references.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
This commit is contained in:
Benjamin Marzinski 2023-01-31 15:22:57 -06:00 • committed by Mike Snitzer
commit d1c0e1587e