From: Dan Carpenter <error27@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] Staging: bcm: return -EFAULT on copy_to_user() errors
Date: Fri, 08 Oct 2010 12:56:58 +0000 [thread overview]
Message-ID: <20101008125658.GM11681@bicker> (raw)
In-Reply-To: <20101008125348.GI11681@bicker>
bcm/InterfaceDld.c had a couple places which returned the number of
bytes remaining instead of -EFAULT.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/staging/bcm/InterfaceDld.c b/drivers/staging/bcm/InterfaceDld.c
index 8825b8e..60c0f29 100644
--- a/drivers/staging/bcm/InterfaceDld.c
+++ b/drivers/staging/bcm/InterfaceDld.c
@@ -167,7 +167,7 @@ static int bcm_download_config_file(PMINI_ADAPTER Adapter,
{
bcm_kfree (Adapter->pstargetparams);
Adapter->pstargetparams = NULL;
- return retval;
+ return -EFAULT;
}
/* Parse the structure and then Download the Firmware */
beceem_parse_target_struct(Adapter);
@@ -385,6 +385,7 @@ int bcm_ioctl_fw_download(PMINI_ADAPTER Adapter, FIRMWARE_INFO *psFwInfo)
if(retval != STATUS_SUCCESS)
{
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "copying buffer from user space failed");
+ retval = -EFAULT;
goto error ;
}
prev parent reply other threads:[~2010-10-08 12:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-08 12:53 [patch] Staging: bcm: return -EFAULT on copy_to_user() failures Dan Carpenter
2010-10-08 12:56 ` Dan Carpenter [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=20101008125658.GM11681@bicker \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
/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.