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

Commit 5f57704d authored by YueHaibing's avatar YueHaibing Committed by Martin K. Petersen
Browse files

scsi: ufs: Use kmemdup in ufshcd_read_string_desc()

parent 3e303a42
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3309,12 +3309,11 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
		str[ret++] = '\0';

	} else {
		str = kzalloc(uc_str->len, GFP_KERNEL);
		str = kmemdup(uc_str, uc_str->len, GFP_KERNEL);
		if (!str) {
			ret = -ENOMEM;
			goto out;
		}
		memcpy(str, uc_str, uc_str->len);
		ret = uc_str->len;
	}
out: