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

Commit f775fb7f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: msm: qdsp6v2: Check for null pointer"

parents 9c1cbc54 737269aa
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -116,6 +116,10 @@ static int audio_output_latency_dbgfs_open(struct inode *inode,
static ssize_t audio_output_latency_dbgfs_read(struct file *file,
				char __user *buf, size_t count, loff_t *ppos)
{
	if (out_buffer == NULL) {
		pr_err("out_buffer is null");
		return 0;
	}
	snprintf(out_buffer, OUT_BUFFER_SIZE, "%ld,%ld,%ld,%ld,%ld,%ld,",\
		out_cold_tv.tv_sec, out_cold_tv.tv_usec, out_warm_tv.tv_sec,\
		out_warm_tv.tv_usec, out_cont_tv.tv_sec, out_cont_tv.tv_usec);
@@ -161,6 +165,10 @@ static int audio_input_latency_dbgfs_open(struct inode *inode,
static ssize_t audio_input_latency_dbgfs_read(struct file *file,
				char __user *buf, size_t count, loff_t *ppos)
{
	if (in_buffer == NULL) {
		pr_err("in_buffer is null");
		return 0;
	}
	snprintf(in_buffer, IN_BUFFER_SIZE, "%ld,%ld,",\
				in_cont_tv.tv_sec, in_cont_tv.tv_usec);
	return  simple_read_from_buffer(buf, IN_BUFFER_SIZE, ppos,
@@ -276,12 +284,16 @@ static void config_debug_fs_write(struct audio_buffer *ab)
static void config_debug_fs_init(void)
{
	out_buffer = kmalloc(OUT_BUFFER_SIZE, GFP_KERNEL);
	if (out_buffer == NULL)
		pr_err("kmalloc() for out_buffer failed");
	out_dentry = debugfs_create_file("audio_out_latency_measurement_node",\
				S_IRUGO | S_IWUSR | S_IWGRP,\
				NULL, NULL, &audio_output_latency_debug_fops);
	if (IS_ERR(out_dentry))
		pr_err("debugfs_create_file failed\n");
	in_buffer = kmalloc(IN_BUFFER_SIZE, GFP_KERNEL);
	if (in_buffer == NULL)
		pr_err("kmalloc() for in_buffer failed");
	in_dentry = debugfs_create_file("audio_in_latency_measurement_node",\
				S_IRUGO | S_IWUSR | S_IWGRP,\
				NULL, NULL, &audio_input_latency_debug_fops);