From: Andrew Yang <andrew.yang@mediatek.com>
To: Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>
Cc: Casper Li <casper.li@mediatek.com>,
andrew.yang <andrew.yang@mediatek.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>
Subject: [PATCH] mm/writeback: fix dereferencing NULL mapping->host
Date: Tue, 29 Nov 2022 11:32:59 +0800 [thread overview]
Message-ID: <20221129033304.4465-1-andrew.yang@mediatek.com> (raw)
From: "andrew.yang" <andrew.yang@mediatek.com>
Check before dereferencing mapping->host
Signed-off-by: andrew.yang <andrew.yang@mediatek.com>
---
include/trace/events/writeback.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 86b2a82da546..56f6e114d3ed 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -68,7 +68,7 @@ DECLARE_EVENT_CLASS(writeback_folio_template,
strscpy_pad(__entry->name,
bdi_dev_name(mapping ? inode_to_bdi(mapping->host) :
NULL), 32);
- __entry->ino = mapping ? mapping->host->i_ino : 0;
+ __entry->ino = mapping && mapping->host ? mapping->host->i_ino : 0;
__entry->index = folio->index;
),
--
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2022-11-29 3:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 3:32 Andrew Yang [this message]
2022-11-29 14:56 ` [PATCH] mm/writeback: fix dereferencing NULL mapping->host Steven Rostedt
2022-11-30 8:23 ` [PATCH v2] " Andrew Yang
2022-11-30 8:23 ` Andrew Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221129033304.4465-1-andrew.yang@mediatek.com \
--to=andrew.yang@mediatek.com \
--cc=casper.li@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).