Skip to content
Commit 3f8c4f5e authored by Joe Hattori's avatar Joe Hattori Committed by Wolfram Sang
Browse files

i2c: core: fix reference leak in i2c_register_adapter()



The reference count of the device incremented in device_initialize() is
not decremented when device_add() fails. Add a put_device() call before
returning from the function.

This bug was found by an experimental static analysis tool that I am
developing.

Fixes: 60f68597 ("i2c: core: Setup i2c_adapter runtime-pm before calling device_add()")
Signed-off-by: default avatarJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
parent 9d895519
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment