diff mbox series

[03/13] fs/acct: Pass a NULL pointer to __kernel_write

Message ID 20201003025534.21045-4-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Matthew Wilcox Oct. 3, 2020, 2:55 a.m. UTC
We do nothing with the updated pos, so we can pass in NULL here.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 kernel/acct.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/kernel/acct.c b/kernel/acct.c
index b0c5b3a9f5af..08f0ec28d188 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -517,9 +517,7 @@  static void do_acct_process(struct bsd_acct_struct *acct)
 	 * as we could deadlock the system otherwise.
 	 */
 	if (file_start_write_trylock(file)) {
-		/* it's been opened O_APPEND, so position is irrelevant */
-		loff_t pos = 0;
-		__kernel_write(file, &ac, sizeof(acct_t), &pos);
+		__kernel_write(file, &ac, sizeof(acct_t), NULL);
 		file_end_write(file);
 	}
 out: