mbox series

[0/2] Added debugfs node initialization and null pointer detection.

Message ID 20240830102153.408675-1-Yibin.Ding@unisoc.com
Headers show
Series Added debugfs node initialization and null pointer detection. | expand

Message

Yibin Ding Aug. 30, 2024, 10:21 a.m. UTC
From: Yibin Ding <Yibin.ding@unisoc.com>

The two debugfs nodes (/sys/kernel/debug/interconnect/test_client/dst_node,
src_node) do not initialize the character pointers before creation. For
such uninitialized nodes, direct access will cause a crash due to accessing
a null pointer.
For example, directly execute the following command after booting:
    cat /sys/kernel/debug/interconnect/test_client/dst_node.

Therefore, for the problem nodes, it is necessary to add initialization
operations and null pointer detection when accessing.

Yibin Ding (2):
  interconnect: Add character pointer initialization
  debugfs: Fix crash problem caused by accessing uninitialized nodes

 drivers/interconnect/debugfs-client.c | 10 ++++++++--
 fs/debugfs/file.c                     |  4 ++++
 2 files changed, 12 insertions(+), 2 deletions(-)