Commit 7881cd6
media: venus: Fix OPP table error handling
The venus driver fails to check if dev_pm_opp_find_freq_{ceil,floor}()
returns an error pointer before calling dev_pm_opp_put(). This causes
a crash when OPP tables are not present in device tree.
Unable to handle kernel access to user memory outside uaccess routines
at virtual address 000000000000002e
...
pc : dev_pm_opp_put+0x1c/0x4c
lr : core_clks_enable+0x4c/0x16c [venus_core]
Add IS_ERR() checks before calling dev_pm_opp_put() to avoid
dereferencing error pointers.
Fixes: b179234 ("media: venus: pm_helpers: use opp-table for the frequency")
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>1 parent adf12a3 commit 7881cd6
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
660 | 661 | | |
661 | 662 | | |
662 | 663 | | |
663 | | - | |
| 664 | + | |
| 665 | + | |
664 | 666 | | |
665 | 667 | | |
666 | 668 | | |
| |||
1121 | 1123 | | |
1122 | 1124 | | |
1123 | 1125 | | |
1124 | | - | |
| 1126 | + | |
| 1127 | + | |
1125 | 1128 | | |
1126 | 1129 | | |
1127 | 1130 | | |
| |||
1131 | 1134 | | |
1132 | 1135 | | |
1133 | 1136 | | |
1134 | | - | |
| 1137 | + | |
| 1138 | + | |
1135 | 1139 | | |
1136 | 1140 | | |
1137 | 1141 | | |
| |||
0 commit comments