Merge "msm: ipa: Change error value for set quota"

This commit is contained in:
Linux Build Service Account 2017-12-20 12:37:46 -08:00 committed by Gerrit - the friendly Code Review server
commit a3cf98624f
4 changed files with 18 additions and 10 deletions

View file

@ -2647,7 +2647,7 @@ static int rmnet_ipa_set_data_quota_modem(struct wan_ioctl_set_data_quota *data)
if (index == MAX_NUM_OF_MUX_CHANNEL) {
IPAWANERR("%s is an invalid iface name\n",
data->interface_name);
return -EFAULT;
return -ENODEV;
}
mux_id = mux_channel[index].mux_id;

View file

@ -61,7 +61,7 @@ static dev_t device;
static long wan_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
int retval = 0;
int retval = 0, rc = 0;
u32 pyld_sz;
u8 *param = NULL;
@ -184,10 +184,14 @@ static long wan_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
retval = -EFAULT;
break;
}
if (rmnet_ipa_set_data_quota(
(struct wan_ioctl_set_data_quota *)param)) {
rc = rmnet_ipa_set_data_quota(
(struct wan_ioctl_set_data_quota *)param);
if (rc != 0) {
IPAWANERR("WAN_IOC_SET_DATA_QUOTA failed\n");
retval = -EFAULT;
if (rc == -ENODEV)
retval = -ENODEV;
else
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {

View file

@ -2791,7 +2791,7 @@ static int rmnet_ipa3_set_data_quota_modem(
if (index == MAX_NUM_OF_MUX_CHANNEL) {
IPAWANERR("%s is an invalid iface name\n",
data->interface_name);
return -EFAULT;
return -ENODEV;
}
mux_id = rmnet_ipa3_ctx->mux_channel[index].mux_id;

View file

@ -71,7 +71,7 @@ static long ipa3_wan_ioctl(struct file *filp,
unsigned int cmd,
unsigned long arg)
{
int retval = 0;
int retval = 0, rc = 0;
u32 pyld_sz;
u8 *param = NULL;
@ -247,10 +247,14 @@ static long ipa3_wan_ioctl(struct file *filp,
retval = -EFAULT;
break;
}
if (rmnet_ipa3_set_data_quota(
(struct wan_ioctl_set_data_quota *)param)) {
rc = rmnet_ipa3_set_data_quota(
(struct wan_ioctl_set_data_quota *)param);
if (rc != 0) {
IPAWANERR("WAN_IOC_SET_DATA_QUOTA failed\n");
retval = -EFAULT;
if (retval == -ENODEV)
retval = -ENODEV;
else
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {