title: i2c: Fix a potential use after free
description: In the Linux kernel, the following vulnerability has been resolved:
i2c: Fix a potential use after free
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.
[wsa: added comment to the code, added Fixes tag]
affected:
{
product: Linux
vendor: Linux
defaultStatus: unaffected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions:
version: 611e12ea0f12, lessThan: e6412ba3b650, status: affected, versionType: git
version: 611e12ea0f12, lessThan: 23a191b132cd, status: affected, versionType: git
version: 611e12ea0f12, lessThan: 871a1e94929a, status: affected, versionType: git
version: 611e12ea0f12, lessThan: 81cb31756888, status: affected, versionType: git
version: 611e12ea0f12, lessThan: 35927d7509ab, status: affected, versionType: git
version: 611e12ea0f12, lessThan: e8e1a046cf87, status: affected, versionType: git
version: 611e12ea0f12, lessThan: 12b0606000d0, status: affected, versionType: git
version: 611e12ea0f12, lessThan: e4c72c06c367, status: affected, versionType: git
}
{
product: Linux
vendor: Linux
defaultStatus: affected
repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
versions:
version: 4.3, status: affected
version: 0, lessThan: 4.3, status: unaffected, versionType: custom
version: 4.14.291, lessThanOrEqual: 4.14.*, status: unaffected, versionType: custom
version: 4.19.256, lessThanOrEqual: 4.19.*, status: unaffected, versionType: custom
version: 5.4.211, lessThanOrEqual: 5.4.*, status: unaffected, versionType: custom
version: 5.10.137, lessThanOrEqual: 5.10.*, status: unaffected, versionType: custom
version: 5.15.61, lessThanOrEqual: 5.15.*, status: unaffected, versionType: custom
version: 5.18.18, lessThanOrEqual: 5.18.*, status: unaffected, versionType: custom
version: 5.19.2, lessThanOrEqual: 5.19.*, status: unaffected, versionType: custom
version: 6.0, lessThanOrEqual: *, status: unaffected, versionType: original_commit_for_fix
}
