]> git.baikalelectronics.ru Git - kernel.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)
commit10bdcab2ba7ae802c46888d026f3b4b1e24ece23
treefc22bac6211f200a76fcc1f4944000e78495b41a
parent9af21ba40760b9df9b3d70853c66371077cb7689
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: 09e9706920a5 ("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