diff mbox series

proc/proc_sysctl: Remove unnecessary 'NULL' values from Pointer

Message ID 20220905012110.2946-1-zeming@nfschina.com (mailing list archive)
State New, archived
Headers show
Series proc/proc_sysctl: Remove unnecessary 'NULL' values from Pointer | expand

Commit Message

Li zeming Sept. 5, 2022, 1:21 a.m. UTC
Pointer variables allocate memory first, and then judge. There is no
need to initialize the assignment.

Signed-off-by: Li zeming <zeming@nfschina.com>
---
 fs/proc/proc_sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luis Chamberlain Sept. 8, 2022, 11:54 p.m. UTC | #1
On Mon, Sep 05, 2022 at 09:21:10AM +0800, Li zeming wrote:
> Pointer variables allocate memory first, and then judge. There is no
> need to initialize the assignment.
> 
> Signed-off-by: Li zeming <zeming@nfschina.com>

you sent the same patch before, and with a different subject...
Anyway the first one was queued up already, in the future please
use a bit better subject.

  Luis
Li zeming Sept. 9, 2022, 1:26 a.m. UTC | #2
Thanks.
diff mbox series

Patch

diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 021e83fe831f..50ba9e4fb284 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -1246,7 +1246,7 @@  static bool get_links(struct ctl_dir *dir,
 static int insert_links(struct ctl_table_header *head)
 {
 	struct ctl_table_set *root_set = &sysctl_table_root.default_set;
-	struct ctl_dir *core_parent = NULL;
+	struct ctl_dir *core_parent;
 	struct ctl_table_header *links;
 	int err;