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

Commit 82b58736 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "seemp: update to seemp_logk_set_mapping()"

parents 746756a9 922e6364
Loading
Loading
Loading
Loading
+12 −14
Original line number Diff line number Diff line
@@ -472,20 +472,6 @@ static long seemp_logk_set_mapping(unsigned long arg)
		(UINT_MAX / sizeof(struct seemp_source_mask))))
		return -EFAULT;

	write_lock(&filter_lock);
	if (pmask != NULL) {
		/*
		 * Mask is getting set again.
		 * seemp_core was probably restarted.
		 */
		struct seemp_source_mask *ptempmask;

		num_sources = 0;
		ptempmask = pmask;
		pmask = NULL;
		kfree(ptempmask);
	}
	write_unlock(&filter_lock);
	pbuffer = kmalloc_array(num_elements,
				sizeof(struct seemp_source_mask), GFP_KERNEL);
	if (pbuffer == NULL)
@@ -511,6 +497,18 @@ static long seemp_logk_set_mapping(unsigned long arg)
		pnewmask[i].isOn = 0;
	}
	write_lock(&filter_lock);
	if (pmask != NULL) {
		/*
		 * Mask is getting set again.
		 * seemp_core was probably restarted.
		 */
		struct seemp_source_mask *ptempmask;

		num_sources = 0;
		ptempmask = pmask;
		pmask = NULL;
		kfree(ptempmask);
	}
	pmask = pnewmask;
	num_sources = num_elements;
	write_unlock(&filter_lock);