From: Andrew Yang <andrew.yang@mediatek.com>
To: <rostedt@goodmis.org>
Cc: <andrew.yang@mediatek.com>, <casper.li@mediatek.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>, <matthias.bgg@gmail.com>,
<mhiramat@kernel.org>
Subject: [PATCH v2] mm/writeback: fix dereferencing NULL mapping->host
Date: Wed, 30 Nov 2022 16:23:02 +0800 [thread overview]
Message-ID: <20221130082303.30859-1-andrew.yang@mediatek.com> (raw)
In-Reply-To: <20221129095620.4c1a8056@gandalf.local.home>
From: "andrew.yang" <andrew.yang@mediatek.com>
Check before dereferencing mapping->host
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: andrew.yang <andrew.yang@mediatek.com>
---
v2: add parenthesis
---
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..54e353c9f919 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
WARNING: multiple messages have this Message-ID (diff)
From: Andrew Yang <andrew.yang@mediatek.com>
To: <rostedt@goodmis.org>
Cc: <andrew.yang@mediatek.com>, <casper.li@mediatek.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>, <matthias.bgg@gmail.com>,
<mhiramat@kernel.org>
Subject: [PATCH v2] mm/writeback: fix dereferencing NULL mapping->host
Date: Wed, 30 Nov 2022 16:23:02 +0800 [thread overview]
Message-ID: <20221130082303.30859-1-andrew.yang@mediatek.com> (raw)
In-Reply-To: <20221129095620.4c1a8056@gandalf.local.home>
From: "andrew.yang" <andrew.yang@mediatek.com>
Check before dereferencing mapping->host
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: andrew.yang <andrew.yang@mediatek.com>
---
v2: add parenthesis
---
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..54e353c9f919 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 prev parent reply other threads:[~2022-11-30 8:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 3:32 [PATCH] mm/writeback: fix dereferencing NULL mapping->host Andrew Yang
2022-11-29 3:32 ` Andrew Yang
2022-11-29 14:56 ` Steven Rostedt
2022-11-29 14:56 ` Steven Rostedt
2022-11-30 8:23 ` Andrew Yang [this message]
2022-11-30 8:23 ` [PATCH v2] " Andrew Yang
2022-11-30 8:23 ` 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=20221130082303.30859-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.