Commit 86ed45f
committed
i2c: Fix a potential use after free
jira VULN-33
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 e656ea9 commit 86ed45f
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2467 | 2467 | | |
2468 | 2468 | | |
2469 | 2469 | | |
2470 | | - | |
2471 | 2470 | | |
| 2471 | + | |
| 2472 | + | |
2472 | 2473 | | |
2473 | 2474 | | |
2474 | 2475 | | |
| |||
0 commit comments