[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d8c5522ddfe034e839cc93e8b4ef36fb@linux.ibm.com>
Date: Mon, 04 Sep 2023 09:20:22 +0200
From: Harald Freudenberger <freude@...ux.ibm.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>
Subject: Re: [PATCH v1 1/2] s390/zcrtpt: Don't leak memory if dev_set_name()
fails
On 2023-08-31 12:59, Andy Shevchenko wrote:
> When dev_set_name() fails, the 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@...ux.intel.com>
> ---
> drivers/s390/crypto/zcrypt_api.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/s390/crypto/zcrypt_api.c
> b/drivers/s390/crypto/zcrypt_api.c
> index 4b23c9f7f3e5..6b99f7dd0643 100644
> --- a/drivers/s390/crypto/zcrypt_api.c
> +++ b/drivers/s390/crypto/zcrypt_api.c
> @@ -413,6 +413,7 @@ static int zcdn_create(const char *name)
> ZCRYPT_NAME "_%d", (int)MINOR(devt));
> nodename[sizeof(nodename) - 1] = '\0';
> if (dev_set_name(&zcdndev->device, nodename)) {
> + kfree(zcdndev);
> rc = -EINVAL;
> goto unlockout;
> }
Thanks Andy, I picked this patch and forwarded it into the s390
subsystem.
This will be visible in Linus' kernel tree with the next merge.
Powered by blists - more mailing lists