Commit 3ba96924 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by sanglipeng
Browse files

s390/zcrypt: don't leak memory if dev_set_name() fails

stable inclusion
from stable-v5.10.195
commit 0878052579cb2773caee64812a811edcab6b5a55
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I95JOC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0878052579cb2773caee64812a811edcab6b5a55



--------------------------------

[ Upstream commit 6252f47b ]

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

Fixes: 00fab235 ("s390/zcrypt: multiple zcrypt device nodes support")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230831110000.24279-1-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 3965b790
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment