mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
scsi: ufs: Fix IOCTL error checking for input buffer
The check for user buffer != NULL in ufshcd_ioctl() should only be done at a point when we know we have a valid IOCTL command. Move this check inside the UFS_IOCTL_QUERY handling code. Change-Id: I10e86b30ae1fdd8c9230db476bb593ccfa94b55c Signed-off-by: Anjana <ahari@codeaurora.org> Signed-off-by: Veera Vegivada <vvegivad@codeaurora.org>
This commit is contained in:
parent
aa860b5b17
commit
0ed7593111
1 changed files with 4 additions and 4 deletions
|
|
@ -2403,13 +2403,13 @@ ufs_qcom_ioctl(struct scsi_device *dev, unsigned int cmd, void __user *buffer)
|
|||
int err = 0;
|
||||
|
||||
BUG_ON(!hba);
|
||||
if (!buffer) {
|
||||
dev_err(hba->dev, "%s: User buffer is NULL!\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
case UFS_IOCTL_QUERY:
|
||||
if (!buffer) {
|
||||
dev_err(hba->dev, "%s: User buffer is NULL!\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
pm_runtime_get_sync(hba->dev);
|
||||
err = ufs_qcom_query_ioctl(hba,
|
||||
ufshcd_scsi_to_upiu_lun(dev->lun),
|
||||
|
|
|
|||
Loading…
Reference in a new issue