From: Dan Carpenter Date: Fri, 8 Oct 2010 12:56:58 +0000 (+0200) Subject: Staging: bcm: return -EFAULT on copy_to_user() errors X-Git-Tag: v2.6.37-rc1~60^2~3^2~213 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef5d2056456d63528daa762b32afa5c430635f33;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Signed-off-by: Greg Kroah-Hartman --- 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 ; }