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

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

Merge "diag: Send error response in case for bad packet"

parents a1e1d98a 0d18ac39
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1115,7 +1115,17 @@ void diag_process_hdlc_pkt(void *data, unsigned len)
		goto end;
	}

	driver->hdlc_buf_len = 0;
	mutex_unlock(&driver->diag_hdlc_mutex);
	return;

fail:
	/*
	 * Tools needs to get a response in order to start its
	 * recovery algorithm. Send an error response if the
	 * packet is not in expected format.
	 */
	diag_send_error_rsp(driver->hdlc_buf, driver->hdlc_buf_len);
	driver->hdlc_buf_len = 0;
end:
	mutex_unlock(&driver->diag_hdlc_mutex);