]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
i2c: dev: check return value when calling dev_set_name()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 11 Apr 2022 18:07:51 +0000 (21:07 +0300)
committerWolfram Sang <wsa@kernel.org>
Fri, 15 Apr 2022 21:23:22 +0000 (23:23 +0200)
commit993eb48fa199b5f476df8204e652eff63dd19361
treefc22bac6211f200a76fcc1f4944000e78495b41a
parentc60bd968c74749a85c71dfed5fabd3e36d487d54
i2c: dev: check return value when calling dev_set_name()

If dev_set_name() fails, the dev_name() is null, check the return
value of dev_set_name() to avoid the null-ptr-deref.

Fixes: 1413ef638aba ("i2c: dev: Fix the race between the release of i2c_dev and cdev")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/i2c-dev.c