Thread (4 messages) 4 messages, 2 authors, 2024-05-13

Re: [PATCH] eventfs: Directly return NULL to avoid null point dereferenced

From: Markus Elfring <hidden>
Date: 2024-05-12 17:13:06
Also in: kernel-janitors, lkml

When the condition ei->is_free holds,we return NULL directly to
avoid update_events_attr to use NULL point about ei.
* Please avoid typos in the summary phrase and the commit message.

* Would you like to use an imperative wording for an improved change description?
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.9-rc7#n94


…
quoted hunk ↗ jump to hunk
+++ b/fs/tracefs/event_inode.c
@@ -346,8 +346,7 @@ static struct eventfs_inode *eventfs_find_events(struct dentry *dentry)
 		 * doesn't matter.
 		 */
 		if (ei->is_freed) {
-			ei = NULL;
-			break;
+			return NULL;
 		}
…

How do you think about to omit curly brackets here?

Regards,
Markus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help