Re: [PATCH 08/13] ASoC: Intel: catpt: Simple sysfs attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-08-07 5:00 PM, Mark Brown wrote:
On Fri, Aug 07, 2020 at 01:06:44PM +0200, Cezary Rojewski wrote:

+// SPDX-License-Identifier: GPL-2.0-pcm

I'm not able to find any references to what license this is - it's not
in https://spdx.org/licenses/ for example.


Indeed. this is a mistake. Will fix in v2.

+	struct catpt_fw_version version;
+	int ret;
+
+	pm_runtime_get_sync(cdev->dev);
+
+	ret = catpt_ipc_get_fw_version(cdev, &version);
+
+	pm_runtime_mark_last_busy(cdev->dev);
+	pm_runtime_put_autosuspend(cdev->dev);
+
+	if (ret)
+		return CATPT_IPC_ERROR(ret);
+
+	memcpy(buf, &version, count);

This will copy count bytes from version regardless of the size of
version - this allows userspace to read the stack and won't truncate the
count to the size of the data read.


Good catch Mark. Ack.



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux