Skip to contentSkip to conversation

fail_function-refctor-code-of-checking-return-value-of-register_kprobe.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Sep 12, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: fail_function: refactor code of checking return value of register_kprobe()
has been removed from the -mm tree. Its filename was
fail_function-refctor-code-of-checking-return-value-of-register_kprobe.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Yang Yingliang <[email protected]>
Subject: fail_function: refactor code of checking return value of register_kprobe()
Date: Fri, 26 Aug 2022 15:33:36 +0800

Refactor the error handling of register_kprobe() to improve readability. No functional change.

---

 kernel/fail_function.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
kernel/fail_function.c renamed from kernel/fail_function.c~fail_function-refctor-code-of-checking-return-value-of-register_kprobe +5 -6
@@ -294,14 +294,13 @@ static ssize_t fei_write(struct file *fi
 	}
 
 	ret = register_kprobe(&attr->kp);
-	if (!ret)
-		fei_debugfs_add_attr(attr);
-	if (ret < 0)
+	if (ret) {
 		fei_attr_remove(attr);
-	else {
-		list_add_tail(&attr->list, &fei_attr_list);
-		ret = count;
+		goto out;
 	}
+	fei_debugfs_add_attr(attr);
+	list_add_tail(&attr->list, &fei_attr_list);
+	ret = count;
 out:
 	mutex_unlock(&fei_lock);
 	kfree(buf);

_

Patches currently in -mm which might be from [email protected] are