Commit 5602bab
committed
i2c: Fix a potential use after free
jira VULN-59661
cve CVE-2019-25162
commit-author Xu Wang <[email protected]>
commit e4c72c0
Free the adap structure only after we are done using it.
This patch just moves the put_device() down a bit to avoid the
use after free.
Fixes: 611e12e ("i2c: core: manage i2c bus device refcount in i2c_[get|put]_adapter")
Signed-off-by: Xu Wang <[email protected]>
[wsa: added comment to the code, added Fixes tag]
Signed-off-by: Wolfram Sang <[email protected]>
(cherry picked from commit e4c72c0)
Signed-off-by: Pratham Patel <[email protected]>1 parent a5b8c8f commit 5602bab
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2479 | 2479 | | |
2480 | 2480 | | |
2481 | 2481 | | |
2482 | | - | |
2483 | 2482 | | |
| 2483 | + | |
| 2484 | + | |
2484 | 2485 | | |
2485 | 2486 | | |
2486 | 2487 | | |
| |||
0 commit comments