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

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

Merge "diag: Modify md_info and diag client map synchronization"

parents 7a7cbb66 1996c2a7
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ int diag_md_write(int id, unsigned char *buf, int len, int ctx)
	}

	found = 0;
	mutex_lock(&driver->diagchar_mutex);
	for (i = 0; i < driver->num_clients && !found; i++) {
		if ((driver->client_map[i].pid != pid) ||
		    (driver->client_map[i].pid == 0))
@@ -202,6 +203,7 @@ int diag_md_write(int id, unsigned char *buf, int len, int ctx)
		pr_debug("diag: wake up logging process\n");
		wake_up_interruptible(&driver->wait_q);
	}
	mutex_unlock(&driver->diagchar_mutex);

	if (!found)
		return -EINVAL;
+6 −4
Original line number Diff line number Diff line
@@ -307,24 +307,26 @@ static void diagfwd_data_read_done(struct diagfwd_info *fwd_info,
		}
	}

	mutex_unlock(&fwd_info->data_mutex);
	mutex_unlock(&driver->hdlc_disable_mutex);

	if (write_len > 0) {
		err = diag_mux_write(DIAG_LOCAL_PROC, write_buf, write_len,
				     temp_buf->ctxt);
		if (err) {
			pr_err_ratelimited("diag: In %s, unable to write to mux error: %d\n",
					   __func__, err);
			goto end;
			goto end_write;
		}
	}
	mutex_unlock(&fwd_info->data_mutex);
	mutex_unlock(&driver->hdlc_disable_mutex);
	diagfwd_queue_read(fwd_info);
	return;

end:
	diag_ws_release();
	mutex_unlock(&fwd_info->data_mutex);
	mutex_unlock(&driver->hdlc_disable_mutex);
end_write:
	diag_ws_release();
	if (temp_buf) {
		diagfwd_write_done(fwd_info->peripheral, fwd_info->type,
				   GET_BUF_NUM(temp_buf->ctxt));