From: Corey Minyard <minyard@acm.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: openipmi-developer@lists.sourceforge.net,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ipmi: ssif_bmc: Uninitialized return in ssif_bmc_write()
Date: Fri, 30 Jul 2021 18:22:36 -0500 [thread overview]
Message-ID: <20210730232236.GE3406@minyard.net> (raw)
In-Reply-To: <20210730150801.GA1074@kili>
On Fri, Jul 30, 2021 at 06:08:01PM +0300, Dan Carpenter wrote:
> I accidentally introduced a bug in my previous patch. The "ret"
> variable needs to be initialized to prevent returning uninitialized
> data.
Thanks Dan, it's queued.
-corey
>
> Fixes: f9714eb04364 ("ipmi: ssif_bmc: Return -EFAULT if copy_from_user() fails")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Sorry!
>
> drivers/char/ipmi/ssif_bmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/ipmi/ssif_bmc.c b/drivers/char/ipmi/ssif_bmc.c
> index ce8cd8364a3f..acdb1d9cb5c0 100644
> --- a/drivers/char/ipmi/ssif_bmc.c
> +++ b/drivers/char/ipmi/ssif_bmc.c
> @@ -80,7 +80,7 @@ static ssize_t ssif_bmc_write(struct file *file, const char __user *buf, size_t
> struct ssif_bmc_ctx *ssif_bmc = to_ssif_bmc(file);
> struct ssif_msg msg;
> unsigned long flags;
> - ssize_t ret;
> + ssize_t ret = 0;
>
> if (count > sizeof(struct ssif_msg))
> return -EINVAL;
> --
> 2.20.1
>
prev parent reply other threads:[~2021-07-30 23:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-30 15:08 [PATCH] ipmi: ssif_bmc: Uninitialized return in ssif_bmc_write() Dan Carpenter
2021-07-30 23:22 ` Corey Minyard [this message]
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=20210730232236.GE3406@minyard.net \
--to=minyard@acm.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
/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).