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

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

Merge "diag: Add NULL pointer checks in mask updates"

parents 405c8311 b8cd1fca
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
/* Copyright (c) 2008-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-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
@@ -112,10 +112,12 @@ static void diag_send_log_mask_update(uint8_t peripheral, int equip_id)
	else
		mask_info = &log_mask;

	if (!mask_info)
	if (!mask_info || !mask_info->ptr || !mask_info->update_buf)
		return;

	mask = (struct diag_log_mask_t *)mask_info->ptr;
	if (!mask->ptr)
		return;
	buf = mask_info->update_buf;

	switch (mask_info->status) {
@@ -224,7 +226,7 @@ static void diag_send_event_mask_update(uint8_t peripheral)
	else
		mask_info = &event_mask;

	if (!mask_info)
	if (!mask_info || !mask_info->ptr || !mask_info->update_buf)
		return;

	buf = mask_info->update_buf;
@@ -305,10 +307,12 @@ static void diag_send_msg_mask_update(uint8_t peripheral, int first, int last)
	else
		mask_info = &msg_mask;

	if (!mask_info)
	if (!mask_info || !mask_info->ptr || !mask_info->update_buf)
		return;

	mask = (struct diag_msg_mask_t *)mask_info->ptr;
	if (!mask->ptr)
		return;
	buf = mask_info->update_buf;
	mutex_lock(&mask_info->lock);
	switch (mask_info->status) {