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

Unverified Commit 18937c66 authored by Olivier Karasangabo's avatar Olivier Karasangabo
Browse files

Merge remote-tracking branch 'caf/LA.BF64.1.2.3_rb1.18' into HEAD

Change-Id: I3be09270be2d322643bb8924e6aeb2b2ef6075cf
parents e5512946 cd8ddb7c
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -213,13 +213,27 @@ static int ath3k_load_firmware(struct usb_device *udev,
{
	u8 *send_buf;
	int err, pipe, len, size, sent = 0;
	int count = firmware->size;
	int count;

	BT_DBG("udev %p", udev);

	if (!firmware || !firmware->data || firmware->size <= 0) {
		err = -EINVAL;
		BT_ERR("Not a valid FW file");
		return err;
	}

	count = firmware->size;

	if (count < FW_HDR_SIZE) {
		err = -EINVAL;
		BT_ERR("ath3k loading invalid size of file");
		return err;
	}

	pipe = usb_sndctrlpipe(udev, 0);

	send_buf = kmalloc(BULK_SIZE, GFP_KERNEL);
	send_buf = kzalloc(BULK_SIZE, GFP_KERNEL);
	if (!send_buf) {
		BT_ERR("Can't allocate memory chunk for firmware");
		return -ENOMEM;
+19 −3
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2138,8 +2138,24 @@ struct diag_dci_client_tbl *dci_lookup_client_entry_pid(int tgid)
{
	struct list_head *start, *temp;
	struct diag_dci_client_tbl *entry = NULL;
	struct pid *pid_struct = NULL;
	struct task_struct *task_s = NULL;

	list_for_each_safe(start, temp, &driver->dci_client_list) {
		entry = list_entry(start, struct diag_dci_client_tbl, track);
		pid_struct = find_get_pid(entry->tgid);
		if (!pid_struct) {
			pr_err("diag: valid pid doesn't exist for pid = %d\n",
				entry->tgid);
			continue;
		}
		task_s = get_pid_task(pid_struct, PIDTYPE_PID);
		if (!task_s) {
			pr_err("diag: valid task doesn't exist for pid = %d\n",
				entry->tgid);
			continue;
		}
		if (task_s == entry->client)
			if (entry->client->tgid == tgid)
				return entry;
	}
+1 −0
Original line number Diff line number Diff line
@@ -130,6 +130,7 @@ struct diag_dci_buf_peripheral_t {
};

struct diag_dci_client_tbl {
	int tgid;
	struct diag_dci_reg_tbl_t client_info;
	struct task_struct *client;
	unsigned char *dci_log_mask;
+5 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ static int diag_dbgfs_bridgeinfo_index;
static int diag_dbgfs_finished;
static int diag_dbgfs_dci_data_index;
static int diag_dbgfs_dci_finished;

static struct mutex diag_dci_dbgfs_mutex;
static ssize_t diag_dbgfs_read_status(struct file *file, char __user *ubuf,
				      size_t count, loff_t *ppos)
{
@@ -357,6 +357,7 @@ static ssize_t diag_dbgfs_read_dcistats(struct file *file,
	buf_size = ksize(buf);
	bytes_remaining = buf_size;

	mutex_lock(&diag_dci_dbgfs_mutex);
	if (diag_dbgfs_dci_data_index == 0) {
		bytes_written =
			scnprintf(buf, buf_size,
@@ -412,8 +413,8 @@ static ssize_t diag_dbgfs_read_dcistats(struct file *file,
		}
		temp_data++;
	}

	diag_dbgfs_dci_data_index = (i >= DIAG_DCI_DEBUG_CNT) ? 0 : i + 1;
	mutex_unlock(&diag_dci_dbgfs_mutex);
	bytes_written = simple_read_from_buffer(ubuf, count, ppos, buf,
								bytes_in_buf);
	kfree(buf);
@@ -1107,6 +1108,7 @@ int diag_debugfs_init(void)
		pr_warn("diag: could not allocate memory for dci debug info\n");

	mutex_init(&dci_stat_mutex);
	mutex_init(&diag_dci_dbgfs_mutex);
	return 0;
err:
	kfree(dci_traffic);
@@ -1123,6 +1125,7 @@ void diag_debugfs_cleanup(void)

	kfree(dci_traffic);
	mutex_destroy(&dci_stat_mutex);
	mutex_destroy(&diag_dci_dbgfs_mutex);
}
#else
int diag_debugfs_init(void) { return 0; }
+5 −1
Original line number Diff line number Diff line
@@ -1049,14 +1049,18 @@ static int diag_ioctl_lsm_deinit(void)
{
	int i;

	mutex_lock(&driver->diagchar_mutex);
	for (i = 0; i < driver->num_clients; i++)
		if (driver->client_map[i].pid == current->tgid)
			break;

	if (i == driver->num_clients)
	if (i == driver->num_clients) {
		mutex_unlock(&driver->diagchar_mutex);
		return -EINVAL;
	}

	driver->data_ready[i] |= DEINIT_TYPE;
	mutex_unlock(&driver->diagchar_mutex);
	wake_up_interruptible(&driver->wait_q);

	return 1;
Loading