]> git.baikalelectronics.ru Git - kernel.git/commit
s390/zcrypt: don't leak memory if dev_set_name() fails
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 31 Aug 2023 10:59:59 +0000 (13:59 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:28:03 +0000 (12:28 +0200)
commit147d8da33a2c2195ec63acd56cd7d80a3458c253
tree0972a1709c6dddd18fc7e438917a87c5f8a6bacf
parentccb048dae8ffc207d1992caec996dc987bf9fe47
s390/zcrypt: don't leak memory if dev_set_name() fails

[ Upstream commit 6252f47b78031979ad919f971dc8468b893488bd ]

When dev_set_name() fails, zcdn_create() doesn't free the newly
allocated resources. Do it.

Fixes: 00fab2350e6b ("s390/zcrypt: multiple zcrypt device nodes support")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230831110000.24279-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/crypto/zcrypt_api.c