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

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

Merge "arm64: app_setting: Fix memory leak when set_name fails"

parents 75960994 d25442f1
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -70,9 +70,16 @@ static int set_name(const char *str, struct kernel_param *kp)

	mutex_lock(&mutex);
	if (count < MAX_ENTRIES) {
		lib_names[count++] = name;
		lib_names[count] = name;
		/*
		 * mb to ensure that the new lib_names entry is present
		 * before updating the view presented by get_lib_names
		 */
		mb();
		count++;
	} else {
		pr_err("app_setting: set name failed. Max entries reached\n");
		kfree(name);
		mutex_unlock(&mutex);
		return -EPERM;
	}