drivers: soc: spss_utils: Handle error return from copy_to_user

Handle error return value from copy_to_user() in ioctls to avoid
following compilation failure.

"error: ignoring return value of function declared with 'warn_unused_result'
 attribute".

Change-Id: I92944ade7fb88e0543ca4254fab226da5777def7
Signed-off-by: Jeevan Shriram <quic_jshriram@quicinc.com>
This commit is contained in:
Jeevan Shriram 2022-01-13 10:38:05 -08:00 committed by Giovanni Ricca
parent 735691b7b1
commit 5454bed576
No known key found for this signature in database

View File

@ -557,9 +557,15 @@ static long spss_utils_ioctl(struct file *file,
return -EINVAL;
}
ret = spss_wait_for_event(req);
copy_to_user((void __user *)arg, data, size);
if (ret < 0)
return ret;
ret = copy_to_user((void __user *)arg, data, size);
if (ret) {
pr_err("cmd [0x%x] copy_to_user failed - %d\n", cmd, ret);
return ret;
}
break;
case SPSS_IOC_SIGNAL_EVENT:
@ -569,9 +575,14 @@ static long spss_utils_ioctl(struct file *file,
return -EINVAL;
}
ret = spss_signal_event(req);
copy_to_user((void __user *)arg, data, size);
if (ret < 0)
return ret;
ret = copy_to_user((void __user *)arg, data, size);
if (ret) {
pr_err("cmd [0x%x] copy_to_user failed - %d\n", cmd, ret);
return ret;
}
break;
case SPSS_IOC_IS_EVENT_SIGNALED:
@ -581,9 +592,15 @@ static long spss_utils_ioctl(struct file *file,
return -EINVAL;
}
ret = spss_is_event_signaled(req);
copy_to_user((void __user *)arg, data, size);
if (ret < 0)
return ret;
ret = copy_to_user((void __user *)arg, data, size);
if (ret) {
pr_err("cmd [0x%x] copy_to_user failed - %d\n", cmd, ret);
return ret;
}
break;
case SPSS_IOC_SET_SSR_STATE: