Caesar Wang 39d1fb94fa media: rockchip: vpss: prevent NULL dereference in rkvpss runtime resume
- Validate vpss[i] and sw_base_addr before memset/memcpy operations
- Add bounds checking for dev_num to prevent array overflow
- Add error logging for invalid sw_base_addr during register restoration

This resolves kernel panic caused by accessing uninitialized sw_base_addr
during power management resume path. The issue occurred when restoring
VPSS hardware registers from suspend state.

Boot up on as below logs:

[    6.869681] lr : rkvpss_hw_runtime_resume+0x160/0x198
[    6.870141] sp : ffffffc00969b930
[    6.870444] x29: ffffffc00969b930 x28: ffffff80035e9800 x27: ffffff80020ad200
[    6.871088] x26: 0000000000000003 x25: ffffffc0091f4000 x24: ffffff8001ed40a8
[    6.871730] x23: ffffffc008cbf000 x22: ffffff8001953010 x21: ffffff8001ed40c8
[    6.872373] x20: 0000000000000002 x19: ffffff8001ed4080 x18: 0000000000000000
[    6.873018] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[    6.873652] x14: ffffff8001fb5025 x13: 0000000000000007 x12: ffffff800142c900
[    6.874284] x11: 0000000000000002 x10: 00000007305dcf59 x9 : 0000000000000000
[    6.874926] x8 : 0000018000000000 x7 : 0000000000000000 x6 : 000000000000003f
[    6.875567] x5 : 0000000000000040 x4 : 0000000000000000 x3 : 0000000000000004
[    6.876208] x2 : 0000000000006f40 x1 : 0000000000000000 x0 : 0000018000000000
[    6.876851] Call trace:
[    6.877076]  __memset+0x16c/0x188
[    6.877375]  pm_generic_runtime_resume+0x24/0x34
[    6.877787]  __rpm_callback+0x40/0x11c
[    6.878129]  rpm_callback+0x68/0x6c
[    6.878448]  rpm_resume+0x304/0x37c
[    6.878767]  __pm_runtime_resume+0x50/0x74
[    6.879132]  ofl_open+0x4c/0xc8
[    6.879419]  v4l2_open+0x98/0xec
[    6.879714]  chrdev_open+0x158/0x164
[    6.880048]  do_dentry_open+0x2d4/0x350

Change-Id: Iab179899258189d7bdf9ccc9bb13d07c25d80910
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2025-03-27 20:43:26 +08:00
2025-01-25 10:26:37 +08:00
2025-01-10 17:48:57 +08:00
2025-01-25 10:26:37 +08:00
2025-01-10 17:48:57 +08:00
2025-01-25 10:26:37 +08:00
2025-01-25 10:26:37 +08:00
2025-01-10 17:48:57 +08:00
2024-11-17 15:07:22 +01:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 7.9 GiB
Languages
C 97.7%
Assembly 1.6%
Makefile 0.3%
Perl 0.1%