]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
i2c: core: fix NULL-deref on adapter registration failure
authorJohan Hovold <johan@kernel.org>
Mon, 11 May 2026 14:37:08 +0000 (16:37 +0200)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 30 May 2026 21:57:18 +0000 (23:57 +0200)
commit2295d2bb101faa663fbc45fadbb3fec45f107441
tree6b8fbf8beab7c7fb804846874f1faa4e718b0028
parent3c7e164344e5bcf6f274bbf59a3274f5caad9bc1
i2c: core: fix NULL-deref on adapter registration failure

If adapter registration ever fails the release callback would trigger a
NULL-pointer dereference as the completion struct has not been
initialised.

Note that before the offending commit this would instead have resulted
in a minor memory leak of the adapter name.

Fixes: 3f8c4f5e9a57 ("i2c: core: fix reference leak in i2c_register_adapter()")
Cc: stable@vger.kernel.org
Cc: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/i2c-core-base.c