Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78947302 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "scsi: ufs: Fix IOCTL error checking for input buffer"

parents 4bcbd3c0 b087cdb3
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -9330,13 +9330,14 @@ static int ufshcd_ioctl(struct scsi_device *dev, 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 = ufshcd_query_ioctl(hba, ufshcd_scsi_to_upiu_lun(dev->lun),
				buffer);