Staging: bcm: return -EFAULT on copy_to_user() errors

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Dan Carpenter 2010-10-08 14:56:58 +02:00 committed by Greg Kroah-Hartman
parent acedadfae5
commit ef5d205645

View File

@ -167,7 +167,7 @@ static int bcm_download_config_file(PMINI_ADAPTER Adapter,
{ {
bcm_kfree (Adapter->pstargetparams); bcm_kfree (Adapter->pstargetparams);
Adapter->pstargetparams = NULL; Adapter->pstargetparams = NULL;
return retval; return -EFAULT;
} }
/* Parse the structure and then Download the Firmware */ /* Parse the structure and then Download the Firmware */
beceem_parse_target_struct(Adapter); beceem_parse_target_struct(Adapter);
@ -385,6 +385,7 @@ int bcm_ioctl_fw_download(PMINI_ADAPTER Adapter, FIRMWARE_INFO *psFwInfo)
if(retval != STATUS_SUCCESS) if(retval != STATUS_SUCCESS)
{ {
BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "copying buffer from user space failed"); BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "copying buffer from user space failed");
retval = -EFAULT;
goto error ; goto error ;
} }