From: Dan Carpenter <dan.carpenter@oracle.com>
To: Danil Kipnis <danil.kipnis@cloud.ionos.com>,
Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
Cc: Jack Wang <jinpu.wang@cloud.ionos.com>,
Jens Axboe <axboe@kernel.dk>,
Lutz Pogrell <lutz.pogrell@cloud.ionos.com>,
linux-block@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink()
Date: Wed, 09 Dec 2020 06:52:19 +0000 [thread overview]
Message-ID: <X9B0IyxwbBDq+cSS@mwanda> (raw)
The "ret" variable should be set to -ENOMEM but it returns uninitialized
stack data.
Fixes: 64e8a6ece1a5 ("block/rnbd-clt: Dynamically alloc buffer for pathname & blk_symlink_name")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/block/rnbd/rnbd-clt-sysfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/rnbd/rnbd-clt-sysfs.c b/drivers/block/rnbd/rnbd-clt-sysfs.c
index c3c96a567568..a5cd47b82b40 100644
--- a/drivers/block/rnbd/rnbd-clt-sysfs.c
+++ b/drivers/block/rnbd/rnbd-clt-sysfs.c
@@ -499,6 +499,7 @@ static int rnbd_clt_add_dev_symlink(struct rnbd_clt_dev *dev)
dev->blk_symlink_name = kzalloc(len, GFP_KERNEL);
if (!dev->blk_symlink_name) {
rnbd_clt_err(dev, "Failed to allocate memory for blk_symlink_name\n");
+ ret = -ENOMEM;
goto out_err;
}
--
2.29.2
next reply other threads:[~2020-12-09 6:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-09 6:52 Dan Carpenter [this message]
2020-12-09 7:28 ` [PATCH] block/rnbd-clt: Fix error code in rnbd_clt_add_dev_symlink() Chaitanya Kulkarni
2020-12-09 7:36 ` Jinpu Wang
2020-12-09 8:03 ` Dan Carpenter
2020-12-09 8:05 ` Jinpu Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=X9B0IyxwbBDq+cSS@mwanda \
--to=dan.carpenter@oracle.com \
--cc=axboe@kernel.dk \
--cc=danil.kipnis@cloud.ionos.com \
--cc=haris.iqbal@cloud.ionos.com \
--cc=jinpu.wang@cloud.ionos.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=lutz.pogrell@cloud.ionos.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).