All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Corey Minyard <minyard@acm.org>
Cc: openipmi-developer@lists.sourceforge.net,
	kernel-janitors@vger.kernel.org
Subject: [PATCH] ipmi: ssif_bmc: Uninitialized return in ssif_bmc_write()
Date: Fri, 30 Jul 2021 18:08:01 +0300	[thread overview]
Message-ID: <20210730150801.GA1074@kili> (raw)

I accidentally introduced a bug in my previous patch.  The "ret"
variable needs to be initialized to prevent returning uninitialized
data.

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


             reply	other threads:[~2021-07-30 15:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 15:08 Dan Carpenter [this message]
2021-07-30 23:22 ` [PATCH] ipmi: ssif_bmc: Uninitialized return in ssif_bmc_write() Corey Minyard

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=20210730150801.GA1074@kili \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=minyard@acm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.